<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of VMT</title>
  <meta name="keywords" content="VMT">
  <meta name="description" content="--- THE VELOCITY MAPPING TOOLBOX ---">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
  <script type="text/javascript">
    if (top.frames.length == 0) { top.location = "../index.html"; };
  </script>
</head>
<body>
<a name="_top"></a>
<!-- menu.html trunk -->
<h1>VMT
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>--- THE VELOCITY MAPPING TOOLBOX ---</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function varargout = VMT(varargin) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> --- THE VELOCITY MAPPING TOOLBOX ---
 
 VMT is a Matlab-based software for processing and visualizing ADCP data
 collected along transects in rivers or other bodies of water. VMT allows
 rapid processing, visualization, and analysis of a range of ADCP datasets
 and includes utilities to export ADCP data to files compatible with
 ArcGIS, Tecplot, and Google Earth. The software can be used to explore
 patterns of three-dimensional fluid motion through several methods for
 calculation of secondary flows (e.g. Rhoads and Kenworthy, 1998; Lane et
 al., 2000). The software also includes capabilities for analyzing the
 acoustic backscatter and bathymetric data from the ADCP. A user-friendly
 graphical user interface (GUI) enhances program functionality and
 provides ready access to two- and three- dimensional plotting functions,
 allowing rapid display and interrogation of velocity, backscatter, and
 bathymetry data.
 
 CITATION: 
 Parsons, D. R., Jackson, P. R., Czuba, J. A., Engel, F. L., Rhoads, B.
 L., Oberg, K. A., Best, J. L., Mueller, D. S., Johnson, K. K. and Riley,
 J. D. (2013), Velocity Mapping Toolbox (VMT): a processing and
 visualization suite for moving-vessel ADCP measurements. Earth Surf.
 Process. Landforms. doi: 10.1002/esp.3367

__________________________________________________________________________
 P.R. Jackson, U.S. Geological Survey, Illinois Water Science Center
 (pjackson@usgs.gov)

 Code contributed by D. Parsons, D. Mueller, J. Czuba, and F. Engel.
__________________________________________________________________________</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="VMT_BuildTecplotFile.html" class="code" title="function VMT_BuildTecplotFile(V,savefile)">VMT_BuildTecplotFile</a>	Takes the processed data structure and writes a TecPlot ASCII data file.</li><li><a href="VMT_BuildTecplotFile_XSBathy.html" class="code" title="function VMT_BuildTecplot_XSBathy(V,savefile)">VMT_BuildTecplotFile_XSBathy</a>	Takes the processed data structure and writes a TecPlot ASCII data file</li><li><a href="VMT_LoadMap.html" class="code" title="function Map = VMT_LoadMap(filetype,coord);">VMT_LoadMap</a>	</li><li><a href="VMT_MBBathy.html" class="code" title="function [A] = VMT_MBBathy(z,A,savefile,beamAng,magVar,wsedata,saveaux)">VMT_MBBathy</a>	Computes the multibeam bathymetry from the four beams of the ADCP</li><li><a href="VMT_MeanXS2GE_3D.html" class="code" title="function VMT_MeanXS2GE_3D(A,V,pathstr,filestr,vscale,voffset)">VMT_MeanXS2GE_3D</a>	Outputs the mean cross section (3-D) from VMT to Google Earth (saved as a</li><li><a href="VMT_OverlayDOQQ.html" class="code" title="function log_text = VMT_OverlayDOQQ(pathname)">VMT_OverlayDOQQ</a>	Prompts the user for a geotiff DOQQ (USGS) and overlays the aerial image</li><li><a href="VMT_PlotPlanViewQuivers.html" class="code" title="function [PVdata,fig_planview_handle,log_text] = VMT_PlotPlanViewQuivers(z,A,V,Map,drng,ascale,QuiverSpacing,pvsmwin,pshore,plot_english,varargin)">VMT_PlotPlanViewQuivers</a>	This function plots a plan view of the measurement region with a vector</li><li><a href="VMT_PlotShiptracks.html" class="code" title="function hf = VMT_PlotShiptracks(A,V,z,setends,hf)">VMT_PlotShiptracks</a>	Plots the shiptracks, and interpolated grid in the VMT GUI axes. Also</li><li><a href="VMT_PlotShoreline.html" class="code" title="function VMT_PlotShoreline(Map)">VMT_PlotShoreline</a>	Plots a shoreline map given the shoreline data structure 'Map' (see</li><li><a href="VMT_PlotXSCont.html" class="code" title="function [z,A,V,zmin,zmax,log_text,fig_contour_handle] = VMT_PlotXSCont(z,A,V,var,exag,plot_english)">VMT_PlotXSCont</a>	Plots contours for the variable 'var' within the mean cross section given</li><li><a href="VMT_PlotXSContQuiver.html" class="code" title="function [z,A,V,log_text] = VMT_PlotXSContQuiver(z,A,V,var,sf,exag,qspchorz,qspcvert,secvecvar,vvelcomp,plot_english)">VMT_PlotXSContQuiver</a>	This function plots the the contour plot (mean XS) for the variable 'var'</li><li><a href="VMT_PreProcess.html" class="code" title="function A = VMT_PreProcess(z,A)">VMT_PreProcess</a>	This function is a driver to preprocess the transects data.  Several</li><li><a href="VMT_ProcessTransects.html" class="code" title="function [A,V,log_text] = VMT_ProcessTransects(z,A,setends)">VMT_ProcessTransects</a>	Driver program to process multiple transects at a single cross-section</li><li><a href="VMT_ReadFiles.html" class="code" title="function [zPathName,zFileName,savefile,A,z] = VMT_ReadFiles(zPathName,zFileName)">VMT_ReadFiles</a>	Read in multiple ASCII output files from WinRiver or WinRiverII.</li><li><a href="VMT_SaveFigs.html" class="code" title="function VMT_SaveFigs(pathname,to_export,figure_style)">VMT_SaveFigs</a>	Saves the figures (specified by fignums) from VMT as .PNG or EPS files</li><li><a href="VMT_SmoothVar.html" class="code" title="function [V] = VMT_SmoothVar(V,hwin,vwin)">VMT_SmoothVar</a>	This routine smooths all processed variables in V struct. By default is</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->

<h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="#_sub1" class="code">function VMT_OpeningFcn(hObject, eventdata, handles, varargin)</a></li><li><a href="#_sub2" class="code">function varargout = VMT_OutputFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub3" class="code">function figure1_ResizeFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub4" class="code">function figure1_CloseRequestFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub5" class="code">function menuFile_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub6" class="code">function menuOpen_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub7" class="code">function menuOpenASCII_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub8" class="code">function menuOpenMAT_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub9" class="code">function menuSave_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub10" class="code">function menuSaveMAT_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub11" class="code">function menuSaveTecplot_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub12" class="code">function menuSaveKMZFile_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub13" class="code">function menuExport_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub14" class="code">function menuFigureExportsettings_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub15" class="code">function menuPrintFormat_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub16" class="code">function menuPresentationFormat_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub17" class="code">function menuExportFigures_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub18" class="code">function menuBathymetryExportSettings_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub19" class="code">function menuExportMultibeamBathymetry_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub20" class="code">function menuSaveANVFile_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub21" class="code">function menuParameters_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub22" class="code">function menuPlottingParameters_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub23" class="code">function menuUnits_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub24" class="code">function menuMetric_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub25" class="code">function menuEnglish_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub26" class="code">function menuSetCrossSectionEndpoints_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub27" class="code">function menuCrossSectionEndpointAutomatic_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub28" class="code">function menuCrossSectionEndpointManual_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub29" class="code">function menuPlotStyle_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub30" class="code">function menuStylePrint_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub31" class="code">function menuStylePresentation_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub32" class="code">function menuProcessingParameters_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub33" class="code">function menuKMZExport_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub34" class="code">function menuBathymetryParameters_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub35" class="code">function menuTools_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub36" class="code">function menuASCII2GIS_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub37" class="code">function menuASCII2KML_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub38" class="code">function menuHelp_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub39" class="code">function menuUsersGuide_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub40" class="code">function menuFunctionLibrary_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub41" class="code">function menuCheckForUpdates_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub42" class="code">function menuAbout_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub43" class="code">function loadDataCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub44" class="code">function saveDataCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub45" class="code">function saveBathymetryCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub46" class="code">function plottingParametersCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub47" class="code">function processingParametersCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub48" class="code">function shiptracksPlotCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub49" class="code">function planviewPlotCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub50" class="code">function crosssectionPlotCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub51" class="code">function SaveMATFile_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub52" class="code">function SaveTecplotFile_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub53" class="code">function SaveGoogleEarthFile_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub54" class="code">function ExportMultibeamBathymetry_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub55" class="code">function BeamAngle_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub56" class="code">function MagneticVariation_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub57" class="code">function WSE_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub58" class="code">function OutputAuxiliaryData_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub59" class="code">function DepthRangeMin_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub60" class="code">function DepthRangeMax_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub61" class="code">function VectorScalePlanView_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub62" class="code">function VectorSpacingPlanview_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub63" class="code">function SmoothingWindowSize_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub64" class="code">function MapDepthAveragedVelocities_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub65" class="code">function DisplayShoreline_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub66" class="code">function AddBackground_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub67" class="code">function PlotPlanView_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub68" class="code">function HorizontalGridNodeSpacing_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub69" class="code">function SetCrossSectionEndpoints_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub70" class="code">function PlotShiptracks_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub71" class="code">function Contour_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub72" class="code">function VerticalExaggeration_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub73" class="code">function VectorScaleCrossSection_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub74" class="code">function HorizontalVectorSpacing_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub75" class="code">function VerticalVectorSpacing_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub76" class="code">function HorizontalSmoothingWindow_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub77" class="code">function VerticalSmoothingWindow_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub78" class="code">function PlotSecondaryFlowVectors_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub79" class="code">function SecondaryFlowVectorVariable_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub80" class="code">function IncludeVerticalVelocity_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub81" class="code">function PlotCrossSection_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub82" class="code">function ClearLog_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub83" class="code">function SaveLog_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub84" class="code">function handles = buildToolbar(handles)</a></li><li><a href="#_sub85" class="code">function load_prefs(hfigure)</a></li><li><a href="#_sub86" class="code">function store_prefs(hfigure,pref)</a></li><li><a href="#_sub87" class="code">function initGUI(handles)</a></li><li><a href="#_sub88" class="code">function set_enable(handles,enable_state)</a></li><li><a href="#_sub89" class="code">function [english_units,set_cross_section_endpoints,plot_presentation_style,plot_print_style] =</a></li><li><a href="#_sub90" class="code">function dialogUnits(hObject,eventdata,handles,the_units)</a></li><li><a href="#_sub91" class="code">function dialogEnpoints(hObject,eventdata,handles,the_endpoints)</a></li><li><a href="#_sub92" class="code">function dialogPlotStyle(hObject,eventdata,handles,the_style)</a></li><li><a href="#_sub93" class="code">function dialogOK(hObject,eventdata,h_OK)</a></li><li><a href="#_sub94" class="code">function dialogCancel(hObject,eventdata,handles)</a></li><li><a href="#_sub95" class="code">function dialogCloseReq(hObject,eventdata,h_OK)</a></li><li><a href="#_sub96" class="code">function [beam_angle,magnetic_variation,wse,output_auxilliary_data] = exportSettingsDialog(beam_angle,magnetic_variation,wse,output_auxilliary_data,hf)</a></li><li><a href="#_sub97" class="code">function dialogExportSettings(hObject,eventdata,handles)</a></li><li><a href="#_sub98" class="code">function [selected_figures] = openFiguresDialog(figure_names,hf)</a></li><li><a href="#_sub99" class="code">function dialogSelectFigures(hObject,eventdata,handles)</a></li><li><a href="#_sub100" class="code">function icons = getIcons</a></li><li><a href="#_sub101" class="code">function guiparams = createGUIparams</a></li></ul>

<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function varargout = VMT(varargin)</a>
0002 <span class="comment">% --- THE VELOCITY MAPPING TOOLBOX ---</span>
0003 <span class="comment">%</span>
0004 <span class="comment">% VMT is a Matlab-based software for processing and visualizing ADCP data</span>
0005 <span class="comment">% collected along transects in rivers or other bodies of water. VMT allows</span>
0006 <span class="comment">% rapid processing, visualization, and analysis of a range of ADCP datasets</span>
0007 <span class="comment">% and includes utilities to export ADCP data to files compatible with</span>
0008 <span class="comment">% ArcGIS, Tecplot, and Google Earth. The software can be used to explore</span>
0009 <span class="comment">% patterns of three-dimensional fluid motion through several methods for</span>
0010 <span class="comment">% calculation of secondary flows (e.g. Rhoads and Kenworthy, 1998; Lane et</span>
0011 <span class="comment">% al., 2000). The software also includes capabilities for analyzing the</span>
0012 <span class="comment">% acoustic backscatter and bathymetric data from the ADCP. A user-friendly</span>
0013 <span class="comment">% graphical user interface (GUI) enhances program functionality and</span>
0014 <span class="comment">% provides ready access to two- and three- dimensional plotting functions,</span>
0015 <span class="comment">% allowing rapid display and interrogation of velocity, backscatter, and</span>
0016 <span class="comment">% bathymetry data.</span>
0017 <span class="comment">%</span>
0018 <span class="comment">% CITATION:</span>
0019 <span class="comment">% Parsons, D. R., Jackson, P. R., Czuba, J. A., Engel, F. L., Rhoads, B.</span>
0020 <span class="comment">% L., Oberg, K. A., Best, J. L., Mueller, D. S., Johnson, K. K. and Riley,</span>
0021 <span class="comment">% J. D. (2013), Velocity Mapping Toolbox (VMT): a processing and</span>
0022 <span class="comment">% visualization suite for moving-vessel ADCP measurements. Earth Surf.</span>
0023 <span class="comment">% Process. Landforms. doi: 10.1002/esp.3367</span>
0024 <span class="comment">%</span>
0025 <span class="comment">%__________________________________________________________________________</span>
0026 <span class="comment">% P.R. Jackson, U.S. Geological Survey, Illinois Water Science Center</span>
0027 <span class="comment">% (pjackson@usgs.gov)</span>
0028 <span class="comment">%</span>
0029 <span class="comment">% Code contributed by D. Parsons, D. Mueller, J. Czuba, and F. Engel.</span>
0030 <span class="comment">%__________________________________________________________________________</span>
0031 
0032 <span class="comment">% Begin initialization code - DO NOT EDIT</span>
0033 gui_Singleton = 1;
0034 gui_State = struct(<span class="string">'gui_Name'</span>,       mfilename, <span class="keyword">...</span>
0035     <span class="string">'gui_Singleton'</span>,  gui_Singleton, <span class="keyword">...</span>
0036     <span class="string">'gui_OpeningFcn'</span>, @<a href="#_sub1" class="code" title="subfunction VMT_OpeningFcn(hObject, eventdata, handles, varargin)">VMT_OpeningFcn</a>, <span class="keyword">...</span>
0037     <span class="string">'gui_OutputFcn'</span>,  @<a href="#_sub2" class="code" title="subfunction varargout = VMT_OutputFcn(hObject, eventdata, handles)">VMT_OutputFcn</a>, <span class="keyword">...</span>
0038     <span class="string">'gui_LayoutFcn'</span>,  [] , <span class="keyword">...</span>
0039     <span class="string">'gui_Callback'</span>,   []);
0040 <span class="keyword">if</span> nargin &amp;&amp; ischar(varargin{1})
0041     gui_State.gui_Callback = str2func(varargin{1});
0042 <span class="keyword">end</span>
0043 
0044 <span class="keyword">if</span> nargout
0045     [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0046 <span class="keyword">else</span>
0047     gui_mainfcn(gui_State, varargin{:});
0048 <span class="keyword">end</span>
0049 <span class="comment">% End initialization code - DO NOT EDIT</span>
0050 
0051 <span class="comment">%#ok&lt;*DEFNU,*INUSL,*INUSD&gt;</span>
0052 
0053 <span class="comment">% --- Executes just before VMT is made visible.</span>
0054 <a name="_sub1" href="#_subfunctions" class="code">function VMT_OpeningFcn(hObject, eventdata, handles, varargin)</a>
0055 <span class="comment">% This function has no output args, see OutputFcn.</span>
0056 <span class="comment">% hObject    handle to figure</span>
0057 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0058 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0059 <span class="comment">% varargin   command line arguments to VMT (see VARARGIN)</span>
0060 
0061 <span class="comment">% Choose default command line output for VMT</span>
0062 handles.output = hObject;
0063 
0064 <span class="comment">% Build the GUI toolbar:</span>
0065 <span class="comment">% ----------------------</span>
0066 handles = <a href="#_sub84" class="code" title="subfunction handles = buildToolbar(handles)">buildToolbar</a>(handles);
0067 
0068 <span class="comment">% Ensure path to utils &amp; docs is available</span>
0069 <span class="comment">% ----------------------------------------</span>
0070 <span class="keyword">if</span> ~isdeployed
0071     filesep = <span class="string">'\'</span>; <span class="comment">% windows</span>
0072     utilspath = [pwd filesep <span class="string">'utils'</span>];
0073     docspath  = [pwd filesep <span class="string">'doc'</span>];
0074     toolspath = [pwd filesep <span class="string">'tools'</span>];
0075     addpath(utilspath,docspath,toolspath)
0076 <span class="keyword">end</span>
0077 
0078 <span class="comment">% Update handles structure</span>
0079 <span class="comment">% ------------------------</span>
0080 guidata(hObject, handles);
0081 
0082 <span class="comment">% Load the GUI preferences:</span>
0083 <span class="comment">% -------------------------</span>
0084 <a href="#_sub85" class="code" title="subfunction load_prefs(hfigure)">load_prefs</a>(handles.figure1)
0085 
0086 <span class="comment">% Initialize the GUI parameters:</span>
0087 <span class="comment">% ------------------------------</span>
0088 guiparams = <a href="#_sub101" class="code" title="subfunction guiparams = createGUIparams">createGUIparams</a>;
0089 guiparams.vmt_version = <span class="string">'v4.0_beta_r2'</span>;
0090 
0091 <span class="comment">% Draw the VMT Background</span>
0092 <span class="comment">% -----------------</span>
0093 pos = get(handles.figure1,<span class="string">'position'</span>);
0094 axes(handles.VMTBackground);
0095 <span class="keyword">if</span> ~isdeployed <span class="comment">%isempty(dir(fullfile(matlabroot,'toolbox','images')))</span>
0096     X = imread(<span class="string">'VMT_Background.png'</span>);
0097     imdisp(X,<span class="string">'size'</span>,[pos(4) pos(3)]) <span class="comment">% Avoids problems with users not having Image Processing TB</span>
0098 <span class="keyword">else</span>
0099     X = imread(<span class="string">'VMT_Background.png'</span>);
0100     X = imresize(X, [pos(4) pos(3)]);
0101     X = uint8(X);
0102     imshow(X,<span class="string">'Border'</span>,<span class="string">'tight'</span>)
0103 <span class="keyword">end</span>
0104 uistack(handles.VMTBackground,<span class="string">'bottom'</span>)
0105 
0106 <span class="comment">% Store the application data:</span>
0107 <span class="comment">% ---------------------------</span>
0108 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0109 
0110 <span class="comment">% Initialize the GUI:</span>
0111 <span class="comment">% -------------------</span>
0112 <a href="#_sub87" class="code" title="subfunction initGUI(handles)">initGUI</a>(handles)
0113 <a href="#_sub88" class="code" title="subfunction set_enable(handles,enable_state)">set_enable</a>(handles,<span class="string">'init'</span>)
0114 <span class="comment">% set(handles.GraphicsExportPanel,'Visible','off')</span>
0115 <span class="comment">% set(handles.ProcessingPanel,'Visible','off')</span>
0116 pos = get(handles.figure1,<span class="string">'Position'</span>);
0117 <span class="comment">% pos(3) = 545;</span>
0118 set(handles.figure1,<span class="string">'Position'</span>,pos)
0119 set(handles.figure1,<span class="string">'Resize'</span>,<span class="string">'on'</span>)
0120 
0121 <span class="comment">% UIWAIT makes VMT wait for user response (see UIRESUME)</span>
0122 <span class="comment">% uiwait(handles.figure1);</span>
0123 <span class="comment">% [EOF] VMT_OpeningFcn</span>
0124 
0125 
0126 <span class="comment">% --- Outputs from this function are returned to the command line.</span>
0127 <a name="_sub2" href="#_subfunctions" class="code">function varargout = VMT_OutputFcn(hObject, eventdata, handles)</a>
0128 <span class="comment">% varargout  cell array for returning output args (see VARARGOUT);</span>
0129 <span class="comment">% hObject    handle to figure</span>
0130 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0131 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0132 
0133 <span class="comment">% Get default command line output from handles structure</span>
0134 varargout{1} = handles.output;
0135 <span class="comment">% [EOF] VMT_OutputFcn</span>
0136 
0137 <span class="comment">% --- Executes when figure1 is resized.</span>
0138 <a name="_sub3" href="#_subfunctions" class="code">function figure1_ResizeFcn(hObject, eventdata, handles)</a>
0139 
0140 <span class="comment">% Draw the VMT Background</span>
0141 <span class="comment">% -----------------</span>
0142 pos = get(handles.figure1,<span class="string">'position'</span>);
0143 axes(handles.VMTBackground);
0144 <span class="keyword">if</span> ~isdeployed <span class="comment">%isempty(dir(fullfile(matlabroot,'toolbox','images')))</span>
0145     X = imread(<span class="string">'VMT_Background.png'</span>);
0146     imdisp(X,<span class="string">'size'</span>,[pos(4) pos(3)]) <span class="comment">% Avoids problems with users not having Image Processing TB</span>
0147 <span class="keyword">else</span>
0148     X = imread(<span class="string">'VMT_Background.png'</span>);
0149     X = imresize(X, [pos(4) pos(3)]);
0150     X = uint8(X);
0151     imshow(X,<span class="string">'Border'</span>,<span class="string">'tight'</span>)
0152 <span class="keyword">end</span>
0153 uistack(handles.VMTBackground,<span class="string">'bottom'</span>)
0154 
0155 <span class="comment">% --- Executes when user attempts to close figure1.</span>
0156 <a name="_sub4" href="#_subfunctions" class="code">function figure1_CloseRequestFcn(hObject, eventdata, handles)</a>
0157 <span class="comment">% hObject    handle to figure1 (see GCBO)</span>
0158 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0159 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0160 
0161 <span class="comment">% Hint: delete(hObject) closes the figure</span>
0162 close_button = questdlg(<span class="keyword">...</span>
0163     <span class="string">'You are about to exit VMT. Any unsaved work will be lost. Are you sure?'</span>,<span class="keyword">...</span>
0164     <span class="string">'Exit VMT?'</span>,<span class="string">'No'</span>);
0165 <span class="keyword">switch</span> close_button
0166     <span class="keyword">case</span> <span class="string">'Yes'</span>
0167         delete(hObject)
0168         close all hidden
0169     <span class="keyword">otherwise</span>
0170         <span class="keyword">return</span>
0171 <span class="keyword">end</span>
0172 <span class="comment">% [EOF] figure1_CloseRequestFcn</span>
0173 
0174 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
0175 <span class="comment">% MENU BAR CALLBACKS %</span>
0176 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
0177 
0178 <span class="comment">% --------------------------------------------------------------------</span>
0179 <a name="_sub5" href="#_subfunctions" class="code">function menuFile_Callback(hObject, eventdata, handles)</a>
0180 <span class="comment">% Empty</span>
0181 
0182 <span class="comment">% --------------------------------------------------------------------</span>
0183 <a name="_sub6" href="#_subfunctions" class="code">function menuOpen_Callback(hObject, eventdata, handles)</a>
0184 <span class="comment">% Empty</span>
0185 
0186 <span class="comment">% --------------------------------------------------------------------</span>
0187 <a name="_sub7" href="#_subfunctions" class="code">function menuOpenASCII_Callback(hObject, eventdata, handles)</a>
0188 <a href="#_sub43" class="code" title="subfunction loadDataCallback(hObject, eventdata, handles)">loadDataCallback</a>(hObject, eventdata, handles)
0189 <span class="comment">% [EOF] menuOpenASCII_Callback</span>
0190 
0191 <span class="comment">% --------------------------------------------------------------------</span>
0192 <a name="_sub8" href="#_subfunctions" class="code">function menuOpenMAT_Callback(hObject, eventdata, handles)</a>
0193 
0194 <span class="comment">% Get the Application data:</span>
0195 <span class="comment">% -------------------------</span>
0196 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0197 guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0198 
0199 <span class="comment">% Ask the user to select files:</span>
0200 <span class="comment">% -----------------------------</span>
0201 <span class="comment">% current_file = fullfile(guiparams.data_folder,guiparams.data_files{1});</span>
0202 <span class="comment">% current_file = fullfile(guiprefs.mat_path,guiprefs.mat_file);</span>
0203 <span class="keyword">if</span> iscell(guiprefs.mat_file)
0204     uifile = fullfile(guiprefs.mat_path,guiprefs.mat_file{1});
0205 <span class="keyword">else</span>
0206     uifile = fullfile(guiprefs.mat_path,guiprefs.mat_file);
0207 <span class="keyword">end</span>
0208 [filename,pathname] = <span class="keyword">...</span>
0209     uigetfile({<span class="string">'*.mat'</span>,<span class="string">'MAT-files (*.mat)'</span>}, <span class="keyword">...</span>
0210     <span class="string">'Select MAT File'</span>, <span class="keyword">...</span>
0211     uifile, <span class="string">'MultiSelect'</span>,<span class="string">'on'</span>);
0212 
0213 <span class="keyword">if</span> ischar(filename) <span class="comment">% Single MAT file loaded</span>
0214     <span class="comment">% Load the data:</span>
0215     <span class="comment">% --------------</span>
0216     vars = load(fullfile(pathname,filename));
0217     
0218     <span class="comment">% Make sure the selected file is a valid file:</span>
0219     <span class="comment">% --------------------------------------------</span>
0220     varnames = fieldnames(vars);
0221     <span class="keyword">if</span> isequal(sort(varnames),{<span class="string">'A'</span> <span class="string">'Map'</span> <span class="string">'V'</span> <span class="string">'z'</span>}')
0222         guiparams.mat_path = pathname;
0223         guiparams.mat_file = filename;
0224         guiparams.z = vars.z;
0225         guiparams.A = vars.A;
0226         guiparams.V = vars.V;
0227         
0228         <span class="comment">% Update the preferences:</span>
0229         <span class="comment">% -----------------------</span>
0230         guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0231         guiprefs.mat_path = pathname;
0232         guiprefs.mat_file = filename;
0233         setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
0234         <a href="#_sub86" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'mat'</span>)
0235                      
0236         <span class="comment">% Re-store the Application Data:</span>
0237         <span class="comment">% ------------------------------</span>
0238         setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0239         
0240         <span class="comment">% Update the GUI:</span>
0241         <span class="comment">% ---------------</span>
0242         <a href="#_sub88" class="code" title="subfunction set_enable(handles,enable_state)">set_enable</a>(handles,<span class="string">'fileloaded'</span>)
0243     <span class="keyword">else</span> <span class="comment">% Not a valid file</span>
0244         errordlg(<span class="string">'The selected file is not a valid ADCP data MAT file.'</span>, <span class="keyword">...</span>
0245             <span class="string">'Invalid File...'</span>)
0246     <span class="keyword">end</span>
0247     
0248 <span class="keyword">elseif</span> iscell(filename) <span class="comment">% Multiple MAT files loaded</span>
0249     <span class="comment">% Set the filenames</span>
0250     <span class="comment">% -----------------</span>
0251     guiparams.mat_path = pathname;
0252     guiparams.mat_file = filename;
0253     
0254     <span class="comment">% Push status to log window</span>
0255     <span class="comment">% -------------------------</span>
0256     log_text = {<span class="keyword">...</span>
0257         <span class="string">'Loading previously processed MAT files.'</span>;<span class="keyword">...</span>
0258         <span class="string">'Directory:'</span>};
0259     log_text = vertcat(log_text, pathname, {<span class="string">'Files:'</span>}, filename');
0260     statusLogging(handles.LogWindow,log_text)
0261     
0262     <span class="comment">% Update the Application Data:</span>
0263     <span class="comment">% ------------------------------</span>
0264     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0265     
0266     <span class="comment">% Update the persistent preferences:</span>
0267     <span class="comment">% ----------------------------------</span>
0268     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0269     guiprefs.mat_path = pathname;
0270     guiprefs.mat_file = filename;
0271     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
0272     <a href="#_sub86" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'mat'</span>)
0273         
0274     <span class="comment">% Update the GUI:</span>
0275     <span class="comment">% ---------------</span>
0276     <a href="#_sub88" class="code" title="subfunction set_enable(handles,enable_state)">set_enable</a>(handles,<span class="string">'multiplematfiles'</span>)
0277 <span class="keyword">end</span>
0278 
0279 <span class="comment">% [EOF] menuOpenMAT_Callback</span>
0280 
0281 <span class="comment">% --------------------------------------------------------------------</span>
0282 <a name="_sub9" href="#_subfunctions" class="code">function menuSave_Callback(hObject, eventdata, handles)</a>
0283 <span class="comment">% Empty</span>
0284 
0285 <span class="comment">% --------------------------------------------------------------------</span>
0286 <a name="_sub10" href="#_subfunctions" class="code">function menuSaveMAT_Callback(hObject, eventdata, handles)</a>
0287 <a href="#_sub44" class="code" title="subfunction saveDataCallback(hObject, eventdata, handles)">saveDataCallback</a>(hObject, eventdata, handles)
0288 <span class="comment">% [EOF] menuSaveMAT_Callback</span>
0289 
0290 <span class="comment">% --------------------------------------------------------------------</span>
0291 <a name="_sub11" href="#_subfunctions" class="code">function menuSaveTecplot_Callback(hObject, eventdata, handles)</a>
0292 <a href="#_sub52" class="code" title="subfunction SaveTecplotFile_Callback(hObject, eventdata, handles)">SaveTecplotFile_Callback</a>(handles,eventdata,handles)
0293 <span class="comment">% [EOF] menuSaveTecplot_Callback</span>
0294 
0295 <span class="comment">% --------------------------------------------------------------------</span>
0296 <a name="_sub12" href="#_subfunctions" class="code">function menuSaveKMZFile_Callback(hObject, eventdata, handles)</a>
0297 <a href="#_sub53" class="code" title="subfunction SaveGoogleEarthFile_Callback(hObject, eventdata, handles)">SaveGoogleEarthFile_Callback</a>(handles,eventdata,handles)
0298 <span class="comment">% [EOF] menuSaveKMZFile_Callback</span>
0299 
0300 <span class="comment">% --------------------------------------------------------------------</span>
0301 <a name="_sub13" href="#_subfunctions" class="code">function menuExport_Callback(hObject, eventdata, handles)</a>
0302 <span class="comment">% Empty</span>
0303 
0304 <span class="comment">% --------------------------------------------------------------------</span>
0305 <a name="_sub14" href="#_subfunctions" class="code">function menuFigureExportsettings_Callback(hObject, eventdata, handles)</a>
0306 <span class="comment">% Empty</span>
0307 
0308 <span class="comment">% --------------------------------------------------------------------</span>
0309 <a name="_sub15" href="#_subfunctions" class="code">function menuPrintFormat_Callback(hObject, eventdata, handles)</a>
0310 
0311 <span class="comment">% Get the Application Data:</span>
0312 <span class="comment">% -------------------------</span>
0313 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0314 
0315 <span class="comment">% Update the Application Data:</span>
0316 <span class="comment">% ----------------------------</span>
0317 guiparams.print        = true;
0318 guiparams.presentation = false;
0319 
0320 <span class="comment">% Re-store the Application data:</span>
0321 <span class="comment">% ------------------------------</span>
0322 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0323 
0324 <span class="comment">% Update the GUI:</span>
0325 <span class="comment">% ---------------</span>
0326 set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0327 set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
0328 
0329 <span class="comment">% [EOF] menuPrintFormat_Callback</span>
0330 
0331 
0332 <span class="comment">% --------------------------------------------------------------------</span>
0333 <a name="_sub16" href="#_subfunctions" class="code">function menuPresentationFormat_Callback(hObject, eventdata, handles)</a>
0334 
0335 <span class="comment">% Get the Application Data:</span>
0336 <span class="comment">% -------------------------</span>
0337 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0338 
0339 <span class="comment">% Update the Application Data:</span>
0340 <span class="comment">% ----------------------------</span>
0341 guiparams.print        = false;
0342 guiparams.presentation = true;
0343 
0344 <span class="comment">% Re-store the Application data:</span>
0345 <span class="comment">% ------------------------------</span>
0346 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0347 
0348 <span class="comment">% Update the GUI:</span>
0349 <span class="comment">% ---------------</span>
0350 set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0351 set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
0352 
0353 <span class="comment">% [EOF] menuPresentationFormat_Callback</span>
0354 
0355 <span class="comment">% --------------------------------------------------------------------</span>
0356 <a name="_sub17" href="#_subfunctions" class="code">function menuExportFigures_Callback(hObject, eventdata, handles)</a>
0357 <span class="comment">% Get the Application data:</span>
0358 <span class="comment">% -------------------------</span>
0359 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0360 guiprefs  = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0361 
0362 <span class="comment">% Find what plots exist already</span>
0363 fig_handles = findobj(<span class="string">'type'</span>,<span class="string">'figure'</span>);
0364 fig_names   = get(fig_handles,<span class="string">'name'</span>);
0365 
0366 <span class="comment">% Remove the VMT GUI as a valid figure in the list</span>
0367 [~, idx] = ismember(get(handles.figure1,<span class="string">'Name'</span>), fig_names);
0368 <span class="keyword">if</span> ~isempty(idx)
0369     fig_names(idx) = [];
0370 <span class="keyword">end</span>
0371 
0372 <span class="keyword">if</span> guiparams.presentation
0373     figure_style = <span class="string">'presentation'</span>;
0374 <span class="keyword">else</span>
0375     figure_style = <span class="string">'print'</span>;
0376 <span class="keyword">end</span>
0377 
0378 [selected_figures] = <a href="#_sub98" class="code" title="subfunction [selected_figures] = openFiguresDialog(figure_names,hf)">openFiguresDialog</a>(fig_names,handles.figure1);
0379 
0380 <span class="keyword">if</span> isempty(selected_figures) <span class="comment">% User pressed cancel</span>
0381     <span class="keyword">return</span>
0382 <span class="keyword">else</span>
0383     <span class="keyword">for</span> i = 1:length(selected_figures)
0384         <a href="VMT_SaveFigs.html" class="code" title="function VMT_SaveFigs(pathname,to_export,figure_style)">VMT_SaveFigs</a>(guiprefs.mat_path,selected_figures(i),figure_style)
0385     <span class="keyword">end</span>
0386 <span class="keyword">end</span>
0387 
0388 
0389 <span class="comment">% [EOF] menuExportFigures_Callback</span>
0390 
0391 <span class="comment">% --------------------------------------------------------------------</span>
0392 <a name="_sub18" href="#_subfunctions" class="code">function menuBathymetryExportSettings_Callback(hObject, eventdata, handles)</a>
0393 <span class="comment">% Get the Application data:</span>
0394 <span class="comment">% -------------------------</span>
0395 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0396 beam_angle = guiparams.beam_angle; 
0397 magnetic_variation = guiparams.magnetic_variation; 
0398 wse = guiparams.wse;
0399 output_auxilliary_data = guiparams.output_auxiliary_data; 
0400 
0401 <span class="comment">% Open dialog and allow user to select settings</span>
0402 <span class="comment">% ---------------------------------------------</span>
0403 [guiparams.beam_angle,<span class="keyword">...</span>
0404     guiparams.magnetic_variation,<span class="keyword">...</span>
0405     guiparams.wse,<span class="keyword">...</span>
0406     guiparams.output_auxilliary_data] = <span class="keyword">...</span>
0407     <a href="#_sub96" class="code" title="subfunction [beam_angle,magnetic_variation,wse,output_auxilliary_data] = exportSettingsDialog(beam_angle,magnetic_variation,wse,output_auxilliary_data,hf)">exportSettingsDialog</a>(beam_angle,magnetic_variation,wse,output_auxilliary_data,handles.figure1);
0408 
0409 <span class="comment">% Re-store the Application data:</span>
0410 <span class="comment">% ------------------------------</span>
0411 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0412 
0413 <span class="comment">% [EOF] menuExportSettings_Callback</span>
0414 
0415 <span class="comment">% --------------------------------------------------------------------</span>
0416 <a name="_sub19" href="#_subfunctions" class="code">function menuExportMultibeamBathymetry_Callback(hObject, eventdata, handles)</a>
0417 <a href="#_sub54" class="code" title="subfunction ExportMultibeamBathymetry_Callback(hObject, eventdata, handles)">ExportMultibeamBathymetry_Callback</a>(hObject, eventdata, handles);
0418 <span class="comment">% [EOF] menuExportMultibeamBathymetry_Callback</span>
0419 
0420 
0421 <span class="comment">% --------------------------------------------------------------------</span>
0422 <a name="_sub20" href="#_subfunctions" class="code">function menuSaveANVFile_Callback(hObject, eventdata, handles)</a>
0423 
0424 <span class="comment">% Get the Application Data:</span>
0425 <span class="comment">% -------------------------</span>
0426 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0427 guiprefs  = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0428 PVdata    = guiparams.iric_anv_planview_data;
0429 iric_path = guiprefs.iric_path;
0430 iric_file = guiprefs.iric_file;
0431 
0432 <span class="comment">% Is there any planview data?</span>
0433 <span class="keyword">if</span> isempty(PVdata)
0434     <span class="comment">% Nothing to do, warn user</span>
0435     log_text = {<span class="string">'No planview plot data to export. User must Plot Plan View first.'</span>};
0436     warndlg(log_text{:},<span class="string">'Nothing to export'</span>)
0437 <span class="keyword">else</span>
0438     <span class="comment">% Save the planview data as output and to an *.anv file with spacing</span>
0439     <span class="comment">% and smoothing (for iRiC)</span>
0440     log_text = {<span class="string">'Exporting iRic formated ANV vector file...'</span>};
0441     [iric_file,iric_path] = uiputfile(<span class="string">'*.anv'</span>,<span class="string">'Save *.anv file'</span>,<span class="keyword">...</span>
0442         fullfile(iric_path,iric_file));
0443     
0444     <span class="keyword">if</span> ischar(iric_path) <span class="comment">% The user did not hit &quot;Cancel&quot;</span>
0445         outfile = fullfile(iric_path,iric_file);
0446         log_text = vertcat(log_text,{outfile});
0447         ofid   = fopen(outfile, <span class="string">'wt'</span>);
0448         outcount = fprintf(ofid,<span class="keyword">...</span>
0449             <span class="string">'%8.2f  %8.2f  %5.2f  %3.3f  %3.3f\n'</span>,PVdata.outmat);
0450         fclose(ofid);
0451     <span class="keyword">else</span>
0452         <span class="comment">% Return default iric_path and iric_file</span>
0453         iric_path = guiprefs.iric_path;
0454         iric_file = guiprefs.iric_file;
0455     <span class="keyword">end</span>
0456 <span class="keyword">end</span>
0457 
0458 <span class="comment">% Push messages to Log Window:</span>
0459 <span class="comment">% ----------------------------</span>
0460 statusLogging(handles.LogWindow, log_text)
0461 
0462 <span class="comment">% Store the persistent preferences:</span>
0463 <span class="comment">% ---------------------------------</span>
0464 guiprefs.iric_file = iric_file;
0465 guiprefs.iric_path = iric_path;
0466 setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
0467 <a href="#_sub86" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'iric'</span>)
0468 
0469 <span class="comment">% [EOF] menuSaveANVFile_Callback</span>
0470 
0471 <span class="comment">% --------------------------------------------------------------------</span>
0472 <a name="_sub21" href="#_subfunctions" class="code">function menuParameters_Callback(hObject, eventdata, handles)</a>
0473 <span class="comment">% Empty</span>
0474 
0475 <span class="comment">% --------------------------------------------------------------------</span>
0476 <a name="_sub22" href="#_subfunctions" class="code">function menuPlottingParameters_Callback(hObject, eventdata, handles)</a>
0477 <span class="comment">% Empty</span>
0478 
0479 <span class="comment">% --------------------------------------------------------------------</span>
0480 <a name="_sub23" href="#_subfunctions" class="code">function menuUnits_Callback(hObject, eventdata, handles)</a>
0481 <span class="comment">% Empty</span>
0482 
0483 <span class="comment">% --------------------------------------------------------------------</span>
0484 <a name="_sub24" href="#_subfunctions" class="code">function menuMetric_Callback(hObject, eventdata, handles)</a>
0485 <span class="comment">% Set the Plotting Parameter Units to &quot;metric&quot;</span>
0486 
0487 <span class="comment">% Get the Application Data:</span>
0488 <span class="comment">% -------------------------</span>
0489 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0490 
0491 <span class="comment">% Update the Application Data:</span>
0492 <span class="comment">% ----------------------------</span>
0493 guiparams.english_units = false;
0494 
0495 <span class="comment">% Re-store the Application data:</span>
0496 <span class="comment">% ------------------------------</span>
0497 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0498 
0499 <span class="comment">% Update the GUI:</span>
0500 <span class="comment">% ---------------</span>
0501 set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0502 set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
0503 
0504 <span class="comment">% [EOF] menuMetric_Callback</span>
0505 
0506 
0507 <span class="comment">% --------------------------------------------------------------------</span>
0508 <a name="_sub25" href="#_subfunctions" class="code">function menuEnglish_Callback(hObject, eventdata, handles)</a>
0509 <span class="comment">% Set the Plotting Parameter Units to &quot;english&quot;</span>
0510 
0511 <span class="comment">% Get the Application Data:</span>
0512 <span class="comment">% -------------------------</span>
0513 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0514 
0515 <span class="comment">% Update the Application Data:</span>
0516 <span class="comment">% ----------------------------</span>
0517 guiparams.english_units = true;
0518 
0519 <span class="comment">% Re-store the Application data:</span>
0520 <span class="comment">% ------------------------------</span>
0521 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0522 
0523 <span class="comment">% Update the GUI:</span>
0524 <span class="comment">% ---------------</span>
0525 set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0526 set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
0527 
0528 <span class="comment">% [EOF] menuEnglish_Callback</span>
0529 
0530 
0531 <span class="comment">% --------------------------------------------------------------------</span>
0532 <a name="_sub26" href="#_subfunctions" class="code">function menuSetCrossSectionEndpoints_Callback(hObject, eventdata, handles)</a>
0533 <span class="comment">% Empty</span>
0534 
0535 <span class="comment">% --------------------------------------------------------------------</span>
0536 <a name="_sub27" href="#_subfunctions" class="code">function menuCrossSectionEndpointAutomatic_Callback(hObject, eventdata, handles)</a>
0537 <span class="comment">% Set cross-section endpoints automatically</span>
0538 
0539 <span class="comment">% Get the Application Data:</span>
0540 <span class="comment">% -------------------------</span>
0541 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0542 
0543 <span class="comment">% Update the Application Data:</span>
0544 <span class="comment">% ----------------------------</span>
0545 guiparams.set_cross_section_endpoints = false;
0546 
0547 <span class="comment">% Re-store the Application data:</span>
0548 <span class="comment">% ------------------------------</span>
0549 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0550 
0551 <span class="comment">% Update the GUI:</span>
0552 <span class="comment">% ---------------</span>
0553 set(handles.menuCrossSectionEndpointAutomatic, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0554 set(handles.menuCrossSectionEndpointManual,    <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0555 
0556 <span class="comment">% [EOF] menuCrossSectionEndpointAutomatic_Callback</span>
0557 
0558 
0559 <span class="comment">% --------------------------------------------------------------------</span>
0560 <a name="_sub28" href="#_subfunctions" class="code">function menuCrossSectionEndpointManual_Callback(hObject, eventdata, handles)</a>
0561 <span class="comment">% Set cross-section endpoints manually</span>
0562 
0563 <span class="comment">% Get the Application Data:</span>
0564 <span class="comment">% -------------------------</span>
0565 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0566 
0567 <span class="comment">% Update the Application Data:</span>
0568 <span class="comment">% ----------------------------</span>
0569 guiparams.set_cross_section_endpoints = true;
0570 
0571 <span class="comment">% Re-store the Application data:</span>
0572 <span class="comment">% ------------------------------</span>
0573 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0574 
0575 <span class="comment">% Update the GUI:</span>
0576 <span class="comment">% ---------------</span>
0577 set(handles.menuCrossSectionEndpointAutomatic, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0578 set(handles.menuCrossSectionEndpointManual,    <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0579 
0580 <span class="comment">% [EOF] menuCrossSectionEndpointManual_Callback</span>
0581 
0582 
0583 
0584 
0585 <span class="comment">% --------------------------------------------------------------------</span>
0586 <a name="_sub29" href="#_subfunctions" class="code">function menuPlotStyle_Callback(hObject, eventdata, handles)</a>
0587 <span class="comment">% Empty</span>
0588 
0589 <span class="comment">% --------------------------------------------------------------------</span>
0590 <a name="_sub30" href="#_subfunctions" class="code">function menuStylePrint_Callback(hObject, eventdata, handles)</a>
0591 
0592 <span class="comment">% Get the Application Data:</span>
0593 <span class="comment">% -------------------------</span>
0594 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0595 
0596 <span class="comment">% Update the Application Data:</span>
0597 <span class="comment">% ----------------------------</span>
0598 guiparams.print        = true;
0599 guiparams.presentation = false;
0600 
0601 <span class="comment">% Re-store the Application data:</span>
0602 <span class="comment">% ------------------------------</span>
0603 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0604 
0605 <span class="comment">% Update the GUI:</span>
0606 <span class="comment">% ---------------</span>
0607 set(handles.menuStylePrint,        <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0608 set(handles.menuStylePresentation, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0609 set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0610 set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
0611 
0612 <span class="comment">% Modify the existing figures</span>
0613 <span class="comment">% ---------------------------</span>
0614 <span class="comment">% Find what plots exist already</span>
0615 hf = findobj(<span class="string">'type'</span>,<span class="string">'figure'</span>);
0616 valid_names = {<span class="string">'Plan View Map'</span>; <span class="string">'Mean Cross Section Contour'</span>};
0617 
0618 <span class="comment">% Defaults for Print Stlye Figure</span>
0619 BkgdColor   = <span class="string">'white'</span>;
0620 AxColor     = <span class="string">'black'</span>;
0621 FigColor    = <span class="string">'white'</span>; <span class="comment">% [0.3 0.3 0.3]</span>
0622 FntSize     = 14;
0623 
0624 <span class="comment">% Loop through valid figures and adjust</span>
0625 <span class="comment">% -------------------------------------</span>
0626 <span class="keyword">if</span> ~isempty(hf) &amp;&amp;  any(ishandle(hf))
0627     
0628     <span class="keyword">for</span> i = 1:length(valid_names)
0629         <span class="keyword">switch</span> valid_names{i}
0630             <span class="keyword">case</span> <span class="string">'Plan View Map'</span>
0631                 <span class="comment">% Focus the figure</span>
0632                 hff = findobj(<span class="string">'name'</span>,<span class="string">'Plan View Map'</span>);
0633                 <span class="keyword">if</span> ~isempty(hff) &amp;&amp;  ishandle(hff)
0634                     figure(hff)
0635                     
0636                     <span class="comment">% Make the changes to figure</span>
0637                     set(gcf,<span class="string">'Color'</span>,BkgdColor);
0638                     set(gca,<span class="string">'FontSize'</span>,FntSize)
0639                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize)
0640                     set(gca,<span class="string">'Color'</span>,FigColor)
0641                     set(gca,<span class="string">'XColor'</span>,AxColor)
0642                     set(gca,<span class="string">'YColor'</span>,AxColor)
0643                     set(gca,<span class="string">'ZColor'</span>,AxColor)
0644                     set(findobj(gcf,<span class="string">'tag'</span>,<span class="string">'Colorbar'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'XColor'</span>,AxColor,<span class="string">'YColor'</span>,AxColor);
0645                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0646                     set(get(gca,<span class="string">'xLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0647                     set(get(gca,<span class="string">'yLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0648                 <span class="keyword">end</span>
0649             <span class="keyword">case</span> <span class="string">'Mean Cross Section Contour'</span>
0650                 <span class="comment">% Focus the figure</span>
0651                 hff = findobj(<span class="string">'name'</span>,<span class="string">'Mean Cross Section Contour'</span>);
0652                 <span class="keyword">if</span> ~isempty(hff) &amp;&amp;  ishandle(hff)
0653                     figure(hff)
0654                     
0655                     <span class="comment">% Make the changes to figure</span>
0656                     set(gcf,<span class="string">'Color'</span>,BkgdColor);
0657                     set(gca,<span class="string">'FontSize'</span>,FntSize)
0658                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize)
0659                     set(gca,<span class="string">'Color'</span>,FigColor)
0660                     set(gca,<span class="string">'XColor'</span>,AxColor)
0661                     set(gca,<span class="string">'YColor'</span>,AxColor)
0662                     set(gca,<span class="string">'ZColor'</span>,AxColor)
0663                     set(findobj(gcf,<span class="string">'tag'</span>,<span class="string">'Colorbar'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'XColor'</span>,AxColor,<span class="string">'YColor'</span>,AxColor);
0664                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0665                     set(get(gca,<span class="string">'xLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0666                     set(get(gca,<span class="string">'yLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0667                     set(findobj(gca,<span class="string">'tag'</span>,<span class="string">'PlotBedElevation'</span>)   ,<span class="string">'color'</span>    ,AxColor)
0668                     set(findobj(gca,<span class="string">'tag'</span>,<span class="string">'ReferenceVectorText'</span>),<span class="string">'color'</span>    ,AxColor)
0669                 <span class="keyword">end</span>
0670             <span class="keyword">otherwise</span>
0671         <span class="keyword">end</span>
0672     <span class="keyword">end</span>
0673     
0674     
0675 <span class="keyword">end</span>
0676 
0677 
0678 <span class="comment">%[EOF] menuStylePrint_Callback</span>
0679 
0680 
0681 <span class="comment">% --------------------------------------------------------------------</span>
0682 <a name="_sub31" href="#_subfunctions" class="code">function menuStylePresentation_Callback(hObject, eventdata, handles)</a>
0683 <span class="comment">% Get the Application Data:</span>
0684 <span class="comment">% -------------------------</span>
0685 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0686 
0687 <span class="comment">% Update the Application Data:</span>
0688 <span class="comment">% ----------------------------</span>
0689 guiparams.print        = false;
0690 guiparams.presentation = true;
0691 
0692 <span class="comment">% Re-store the Application data:</span>
0693 <span class="comment">% ------------------------------</span>
0694 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0695 
0696 <span class="comment">% Update the GUI:</span>
0697 <span class="comment">% ---------------</span>
0698 set(handles.menuStylePrint,        <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0699 set(handles.menuStylePresentation, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0700 set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0701 set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
0702 
0703 <span class="comment">% Modify the existing figures</span>
0704 <span class="comment">% ---------------------------</span>
0705 <span class="comment">% Find what plots exist already</span>
0706 hf = findobj(<span class="string">'type'</span>,<span class="string">'figure'</span>);
0707 valid_names = {<span class="string">'Plan View Map'</span>; <span class="string">'Mean Cross Section Contour'</span>};
0708 
0709 <span class="comment">% Defaults for Print Stlye Figure</span>
0710 <span class="comment">% -------------------------------</span>
0711 BkgdColor   = <span class="string">'black'</span>;
0712 AxColor     = <span class="string">'white'</span>;
0713 FigColor    = <span class="string">'black'</span>; <span class="comment">% [0.3 0.3 0.3]</span>
0714 FntSize     = 14;
0715 
0716 <span class="comment">% Loop through valid figures and adjust</span>
0717 <span class="comment">% -------------------------------------</span>
0718 <span class="keyword">if</span> ~isempty(hf) &amp;&amp;  any(ishandle(hf))
0719     
0720     <span class="keyword">for</span> i = 1:length(valid_names)
0721         <span class="keyword">switch</span> valid_names{i}
0722             <span class="keyword">case</span> <span class="string">'Plan View Map'</span>
0723                 <span class="comment">% Focus the figure</span>
0724                 hff = findobj(<span class="string">'name'</span>,<span class="string">'Plan View Map'</span>);
0725                 <span class="keyword">if</span> ~isempty(hff) &amp;&amp;  ishandle(hff)
0726                     figure(hff)
0727                     
0728                     <span class="comment">% Make the changes to figure</span>
0729                     set(gcf,<span class="string">'Color'</span>,BkgdColor);
0730                     set(gca,<span class="string">'FontSize'</span>,FntSize)
0731                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize)
0732                     set(gca,<span class="string">'Color'</span>,FigColor)
0733                     set(gca,<span class="string">'XColor'</span>,AxColor)
0734                     set(gca,<span class="string">'YColor'</span>,AxColor)
0735                     set(gca,<span class="string">'ZColor'</span>,AxColor)
0736                     set(findobj(gcf,<span class="string">'tag'</span>,<span class="string">'Colorbar'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'XColor'</span>,AxColor,<span class="string">'YColor'</span>,AxColor);
0737                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0738                     set(get(gca,<span class="string">'xLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0739                     set(get(gca,<span class="string">'yLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0740                 <span class="keyword">end</span>
0741             <span class="keyword">case</span> <span class="string">'Mean Cross Section Contour'</span>
0742                 <span class="comment">% Focus the figure</span>
0743                 hff = findobj(<span class="string">'name'</span>,<span class="string">'Mean Cross Section Contour'</span>);
0744                 <span class="keyword">if</span> ~isempty(hff) &amp;&amp;  ishandle(hff)
0745                     figure(hff)
0746                     
0747                     <span class="comment">% Make the changes to figure</span>
0748                     set(gcf,<span class="string">'Color'</span>,BkgdColor);
0749                     set(gca,<span class="string">'FontSize'</span>,FntSize)
0750                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize)
0751                     set(gca,<span class="string">'Color'</span>,[0.3 0.3 0.3]) <span class="comment">%FigColor)</span>
0752                     set(gca,<span class="string">'XColor'</span>,AxColor)
0753                     set(gca,<span class="string">'YColor'</span>,AxColor)
0754                     set(gca,<span class="string">'ZColor'</span>,AxColor)
0755                     set(findobj(gcf,<span class="string">'tag'</span>,<span class="string">'Colorbar'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'XColor'</span>,AxColor,<span class="string">'YColor'</span>,AxColor);
0756                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0757                     set(get(gca,<span class="string">'xLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0758                     set(get(gca,<span class="string">'yLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0759                     set(findobj(gca,<span class="string">'tag'</span>,<span class="string">'PlotBedElevation'</span>)   ,<span class="string">'color'</span>    ,AxColor)
0760                     set(findobj(gca,<span class="string">'tag'</span>,<span class="string">'ReferenceVectorText'</span>),<span class="string">'color'</span>    ,AxColor)
0761                 <span class="keyword">end</span>
0762             <span class="keyword">otherwise</span>
0763         <span class="keyword">end</span>
0764     <span class="keyword">end</span>
0765     
0766     
0767 <span class="keyword">end</span>
0768 
0769 <span class="comment">% [EOF] menuStylePresentation_Callback</span>
0770 
0771 
0772 <span class="comment">% --------------------------------------------------------------------</span>
0773 <a name="_sub32" href="#_subfunctions" class="code">function menuProcessingParameters_Callback(hObject, eventdata, handles)</a>
0774 <span class="comment">% Empty</span>
0775 
0776 <span class="comment">% --------------------------------------------------------------------</span>
0777 <a name="_sub33" href="#_subfunctions" class="code">function menuKMZExport_Callback(hObject, eventdata, handles)</a>
0778 
0779 <span class="comment">% Get the Application data:</span>
0780 <span class="comment">% -------------------------</span>
0781 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0782 
0783 <span class="comment">% Initialize the answer:</span>
0784 <span class="comment">% ----------------------</span>
0785 numstr = {num2str(guiparams.vertical_offset)};
0786 answer = NaN;
0787 <span class="keyword">while</span> isnan(answer)
0788     answer = inputdlg(<span class="string">'Vertical Offset (m)'</span>,<span class="string">'KMZ Export'</span>,1,numstr);
0789     
0790     <span class="keyword">if</span> isempty(answer) <span class="comment">% User hits &quot;Cancel&quot;</span>
0791         <span class="keyword">return</span>
0792     <span class="keyword">end</span>
0793     
0794     answer = str2double(answer); <span class="comment">% A non-numeric char will be NaN</span>
0795     <span class="comment">% A numeric char will be a double</span>
0796 <span class="keyword">end</span>
0797 
0798 <span class="comment">% Re-store the Application data:</span>
0799 <span class="comment">% ------------------------------</span>
0800 guiparams.vertical_offset = answer;
0801 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0802 
0803 <span class="comment">% [EOF] menuKMZExport_Callback</span>
0804 
0805 <span class="comment">% --------------------------------------------------------------------</span>
0806 <a name="_sub34" href="#_subfunctions" class="code">function menuBathymetryParameters_Callback(hObject, eventdata, handles)</a>
0807 <span class="comment">% Not implemented</span>
0808 
0809 <span class="comment">% --------------------------------------------------------------------</span>
0810 <a name="_sub35" href="#_subfunctions" class="code">function menuTools_Callback(hObject, eventdata, handles)</a>
0811 <span class="comment">% Empty</span>
0812 
0813 <span class="comment">% --------------------------------------------------------------------</span>
0814 <a name="_sub36" href="#_subfunctions" class="code">function menuASCII2GIS_Callback(hObject, eventdata, handles)</a>
0815 ASCII2GIS_GUI
0816 <span class="comment">% [EOF] menuASCII2GIS_Callback</span>
0817 
0818 <span class="comment">% --------------------------------------------------------------------</span>
0819 <a name="_sub37" href="#_subfunctions" class="code">function menuASCII2KML_Callback(hObject, eventdata, handles)</a>
0820 
0821 <span class="comment">% Get the Application preferences:</span>
0822 <span class="comment">% --------------------------------</span>
0823 guiprefs  = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0824 
0825 inpath = guiprefs.kmz_path;
0826 <span class="keyword">if</span> iscell(guiprefs.kmz_file)
0827     infile = guiprefs.kmz_file{1};
0828 <span class="keyword">else</span>
0829     infile = guiprefs.kmz_file;
0830 <span class="keyword">end</span>
0831 [log_text,outpath,outfile] = ASCII2KML(inpath,infile);
0832 
0833 guiprefs.kmz_path = outpath;
0834 guiprefs.kmz_file = outfile;
0835 
0836 <span class="comment">% Update persistent preferences</span>
0837 <span class="comment">% -----------------------------</span>
0838 setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
0839 
0840 <span class="comment">% [EOF] menuASCII2KML_Callback</span>
0841 
0842 <span class="comment">% --------------------------------------------------------------------</span>
0843 <a name="_sub38" href="#_subfunctions" class="code">function menuHelp_Callback(hObject, eventdata, handles)</a>
0844 <span class="comment">% Empty</span>
0845 
0846 <span class="comment">% --------------------------------------------------------------------</span>
0847 <a name="_sub39" href="#_subfunctions" class="code">function menuUsersGuide_Callback(hObject, eventdata, handles)</a>
0848 <span class="keyword">try</span>
0849     web(<span class="string">'http://code.google.com/p/velocity-mapping-tool/wiki/UserGuide?tm=6'</span>)
0850 <span class="keyword">catch</span> err <span class="comment">%#ok&lt;NASGU&gt;</span>
0851     h = errordlg(<span class="string">'No internet connectivity. Try again later.'</span>,<span class="keyword">...</span>
0852         <span class="string">'Online User Guide unavailable'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
0853 <span class="keyword">end</span>
0854 <span class="comment">% [EOF] menuASCII2KML_Callback</span>
0855 
0856 <span class="comment">% --------------------------------------------------------------------</span>
0857 <a name="_sub40" href="#_subfunctions" class="code">function menuFunctionLibrary_Callback(hObject, eventdata, handles)</a>
0858 <span class="comment">% Get the Application data:</span>
0859 <span class="comment">% -------------------------</span>
0860 <span class="comment">% guiparams = getappdata(handles.figure1,'guiparams'); %#ok&lt;NASGU&gt;</span>
0861 
0862 <span class="keyword">try</span>
0863     <span class="comment">% Construct a URL to a local file which can be interpreted by any</span>
0864     <span class="comment">% web-browser</span>
0865     rootpath = strrep(pwd,filesep,<span class="string">'/'</span>);
0866     webaddress = [<span class="string">'file:///'</span> rootpath <span class="string">'/doc/index.html'</span>];
0867     system([<span class="string">'start '</span> webaddress]);
0868 <span class="comment">%     [stat,h,url] = web(webaddress) % Produced with m2html (FEX)</span>
0869 <span class="keyword">catch</span> err 
0870     error(<span class="string">'VMT:guiInterface'</span>,<span class="keyword">...</span>
0871         horzcat(<span class="string">'Unable to open function library. \n'</span>,<span class="keyword">...</span>
0872         <span class="string">'Attempted to find function library at the URL:\n'</span>,<span class="keyword">...</span>
0873         <span class="string">'   %s'</span>), webaddress)
0874     <span class="keyword">return</span>
0875 <span class="keyword">end</span>
0876 
0877 <span class="comment">% [EOF] menuFunctionLibrary_Callback</span>
0878 
0879 <span class="comment">% --------------------------------------------------------------------</span>
0880 <a name="_sub41" href="#_subfunctions" class="code">function menuCheckForUpdates_Callback(hObject, eventdata, handles)</a>
0881 
0882 <span class="comment">% Get the Application data:</span>
0883 <span class="comment">% -------------------------</span>
0884 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0885 
0886 <span class="comment">% Check version tag against the web, and display a message</span>
0887 <span class="keyword">try</span>
0888     current_vmt_version = urlread(<span class="string">'http://hydroacoustics.usgs.gov/movingboat/VMT/VMT_version.txt'</span>);
0889     <span class="comment">%     current_vmt_version = urlread('http://hydroacoustics.usgs.gov/movingboat/VMT/VMT_version.txt');</span>
0890 <span class="keyword">catch</span> err <span class="comment">%#ok&lt;NASGU&gt;</span>
0891     h = msgbox(<span class="string">'No internet connection. Try again later.'</span>,<span class="string">'Check for updates'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
0892     <span class="keyword">return</span>
0893 <span class="keyword">end</span>
0894 
0895 <span class="keyword">if</span> strcmpi(guiparams.vmt_version,current_vmt_version)
0896     h = msgbox(<span class="string">'VMT is currently up to date, no updates available.'</span>,<span class="string">'Check for updates'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
0897 <span class="keyword">else</span>
0898     h = msgbox(<span class="string">'VMT is out of date. Please visit the VMT homepage.'</span>,<span class="string">'Check for updates'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
0899 <span class="keyword">end</span>
0900 <span class="comment">% [EOF] menuCheckForUpdates_Callback</span>
0901 
0902 <span class="comment">% --------------------------------------------------------------------</span>
0903 <a name="_sub42" href="#_subfunctions" class="code">function menuAbout_Callback(hObject, eventdata, handles)</a>
0904 
0905 <span class="comment">% Get the Application data:</span>
0906 <span class="comment">% -------------------------</span>
0907 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0908 messagestr = <span class="keyword">...</span>
0909     {<span class="string">'The Velocity Mapping Toolbox'</span>;<span class="keyword">...</span>
0910     [<span class="string">'   Version: '</span> guiparams.vmt_version];<span class="keyword">...</span>
0911     <span class="string">''</span>;<span class="keyword">...</span>
0912     <span class="string">''</span>;<span class="keyword">...</span>
0913     <span class="string">'With collaborations from:'</span>;<span class="keyword">...</span>
0914     <span class="string">'   U.S. Geological Survey'</span>;<span class="keyword">...</span>
0915     <span class="string">'   University of Illinois'</span>;<span class="keyword">...</span>
0916     <span class="string">'   University of Hull'</span>;<span class="keyword">...</span>
0917     <span class="string">''</span>;<span class="keyword">...</span>
0918     <span class="string">''</span>;<span class="keyword">...</span>
0919     <span class="string">'Citation: '</span>;<span class="keyword">...</span>
0920     <span class="string">'   Parsons, D. R., Jackson, P. R., Czuba, J. A., Engel, F. L.,'</span>;<span class="keyword">...</span>
0921     <span class="string">'   Rhoads, B. L., Oberg, K. A., Best, J. L., Mueller, D. S.,'</span>;<span class="keyword">...</span>
0922     <span class="string">'   Johnson, K. K. and Riley, J. D. (2013), Velocity Mapping'</span>;<span class="keyword">...</span>
0923     <span class="string">'   Toolbox (VMT): a processing and visualization suite for'</span>;<span class="keyword">...</span>
0924     <span class="string">'   moving-vessel ADCP measurements. Earth Surf. Process.'</span>;<span class="keyword">...</span>
0925     <span class="string">'   Landforms.doi: 10.1002/esp.3367'</span>};
0926 h = msgbox(messagestr,<span class="string">'About VMT'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
0927 <span class="comment">% [EOF] menuAbout_Callback</span>
0928 
0929 
0930 
0931 
0932 <span class="comment">%%%%%%%%%%%%%%%%%%%%%</span>
0933 <span class="comment">% TOOLBAR CALLBACKS %</span>
0934 <span class="comment">%%%%%%%%%%%%%%%%%%%%%</span>
0935 
0936 <span class="comment">% --------------------------------------------------------------------</span>
0937 <a name="_sub43" href="#_subfunctions" class="code">function loadDataCallback(hObject, eventdata, handles)</a>
0938 <span class="comment">% Read Files into Data Structure using tfile.</span>
0939 
0940 <span class="comment">% Get the Application data:</span>
0941 <span class="comment">% -------------------------</span>
0942 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0943 guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0944 
0945 <span class="comment">% Ask the user to select files:</span>
0946 <span class="comment">% -----------------------------</span>
0947 current_file = fullfile(guiprefs.ascii_path,guiprefs.ascii_file{1});
0948 [filename,pathname] = uigetfile({<span class="string">'*_ASC.TXT'</span>,<span class="string">'ASCII (*_ASC.TXT)'</span>}, <span class="keyword">...</span>
0949     <span class="string">'Select the ASCII Output Files'</span>, <span class="keyword">...</span>
0950     current_file, <span class="keyword">...</span>
0951     <span class="string">'MultiSelect'</span>,<span class="string">'on'</span>);
0952 
0953 <span class="keyword">if</span> ischar(pathname) <span class="comment">% The user did not hit &quot;Cancel&quot;</span>
0954     guiparams.data_folder = pathname;
0955     <span class="keyword">if</span> ischar(filename)
0956         filename = {filename};
0957     <span class="keyword">end</span>
0958     guiparams.data_files = filename;
0959     guiparams.mat_file = <span class="string">''</span>;
0960     
0961     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0962     
0963    
0964     
0965     <span class="comment">% Update the preferences:</span>
0966     <span class="comment">% -----------------------</span>
0967     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0968     guiprefs.ascii_path = pathname;
0969     guiprefs.ascii_file = filename;
0970     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
0971     <a href="#_sub86" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'ascii'</span>)
0972     
0973     <span class="comment">% Push messages to Log Window:</span>
0974     <span class="comment">% ----------------------------</span>
0975     log_text = {<span class="keyword">...</span>
0976         <span class="string">''</span>;<span class="keyword">...</span>
0977         [<span class="string">'%--- '</span> datestr(now) <span class="string">' ---%'</span>];<span class="keyword">...</span>
0978         <span class="string">'Current Project Directory:'</span>;<span class="keyword">...</span>
0979         guiparams.data_folder;
0980         <span class="string">'Loading the following files into memory:'</span>;<span class="keyword">...</span>
0981         char(filename)};
0982     statusLogging(handles.LogWindow, log_text)
0983     
0984     <span class="comment">% Read the file(s)</span>
0985     <span class="comment">% ----------------</span>
0986     [~,~,savefile,A,z] = <span class="keyword">...</span>
0987         <a href="VMT_ReadFiles.html" class="code" title="function [zPathName,zFileName,savefile,A,z] = VMT_ReadFiles(zPathName,zFileName)">VMT_ReadFiles</a>(guiparams.data_folder,guiparams.data_files);
0988     guiparams.savefile = savefile;
0989     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0990     
0991     <span class="comment">% Preprocess the data:</span>
0992     <span class="comment">% --------------------</span>
0993     A = <a href="VMT_PreProcess.html" class="code" title="function A = VMT_PreProcess(z,A)">VMT_PreProcess</a>(z,A);
0994     
0995     <span class="comment">% Push messages to Log Window:</span>
0996     <span class="comment">% ----------------------------</span>
0997     log_text = {<span class="keyword">...</span>
0998         <span class="string">'   Preprocessing complete.'</span>;<span class="keyword">...</span>
0999         <span class="string">'   Begin Data Processing...'</span>};
1000     statusLogging(handles.LogWindow, log_text)
1001     
1002     A(1).hgns = guiparams.horizontal_grid_node_spacing;
1003     A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
1004     [A,V,processing_log_text] = <a href="VMT_ProcessTransects.html" class="code" title="function [A,V,log_text] = VMT_ProcessTransects(z,A,setends)">VMT_ProcessTransects</a>(z,A,guiparams.set_cross_section_endpoints);
1005     
1006     <span class="comment">% Push messages to Log Window:</span>
1007     <span class="comment">% ----------------------------</span>
1008     statusLogging(handles.LogWindow, processing_log_text)
1009     
1010     <span class="comment">% Store the data:</span>
1011     <span class="comment">% ---------------</span>
1012     guiparams.z = z;
1013     guiparams.A = A;
1014     guiparams.V = V;
1015     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1016     
1017       
1018     <span class="comment">% Update the GUI:</span>
1019     <span class="comment">% ---------------</span>
1020     <a href="#_sub88" class="code" title="subfunction set_enable(handles,enable_state)">set_enable</a>(handles,<span class="string">'fileloaded'</span>)
1021 <span class="keyword">end</span>
1022 <span class="comment">% [EOF] loadDataCallback</span>
1023 
1024 
1025 
1026 <span class="comment">% --------------------------------------------------------------------</span>
1027 <a name="_sub44" href="#_subfunctions" class="code">function saveDataCallback(hObject, eventdata, handles)</a>
1028 <span class="comment">% SaveMATFile_Callback(handles.SaveMATFile,eventdata,handles)</span>
1029 
1030 <span class="comment">% Get the Application data:</span>
1031 <span class="comment">% -------------------------</span>
1032 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1033 z   = guiparams.z;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1034 A   = guiparams.A;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1035 V   = guiparams.V;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1036 Map = guiparams.Map; <span class="comment">%#ok&lt;NASGU&gt;</span>
1037 
1038 [the_file,the_path] = <span class="keyword">...</span>
1039     uiputfile({<span class="string">'*.mat'</span>,<span class="string">'MAT-Files (*.mat)'</span>}, <span class="keyword">...</span>
1040     <span class="string">'Save MAT-File'</span>, <span class="keyword">...</span>
1041     fullfile(guiparams.mat_path,guiparams.savefile));
1042 
1043 <span class="comment">% Save the processed data to a MAT file:</span>
1044 <span class="comment">% --------------------------------------</span>
1045 <span class="keyword">if</span> ischar(the_file)
1046     guiparams.mat_path = the_path;
1047     guiparams.mat_file = the_file;
1048     guiparams.savefile = the_file;
1049     
1050     <span class="comment">% Re-store the Application data:</span>
1051     <span class="comment">% ------------------------------</span>
1052     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1053     
1054     <span class="comment">% Update the preferences:</span>
1055     <span class="comment">% -----------------------</span>
1056     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1057     guiprefs.mat_path = the_path;
1058     guiprefs.mat_file = the_file;
1059     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
1060     <a href="#_sub86" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'mat'</span>)
1061     
1062     [pathstr,filename,extension] = fileparts([guiparams.mat_path guiparams.savefile]);
1063     savefile = fullfile(pathstr,[filename extension]);
1064     <span class="comment">%h = msgbox(['Saving processed data in MAT File ''' filename extension ''''], ...</span>
1065     <span class="comment">%    'Saving Processed Data File...'); %#ok&lt;NASGU&gt;</span>
1066     log_text = {<span class="keyword">...</span>
1067         <span class="string">'Saving Processed Data File...'</span>;<span class="keyword">...</span>
1068         savefile};
1069     statusLogging(handles.LogWindow,log_text)
1070     save(savefile,<span class="string">'A'</span>,<span class="string">'V'</span>,<span class="string">'z'</span>,<span class="string">'Map'</span>)
1071 <span class="keyword">end</span>
1072 
1073 <span class="comment">% [EOF] saveDataCallback</span>
1074 
1075 
1076 <span class="comment">% --------------------------------------------------------------------</span>
1077 <a name="_sub45" href="#_subfunctions" class="code">function saveBathymetryCallback(hObject, eventdata, handles)</a>
1078 
1079 <span class="comment">% Get the Application data:</span>
1080 <span class="comment">% -------------------------</span>
1081 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1082 z   = guiparams.z;
1083 A   = guiparams.A;
1084 <span class="comment">% V   = guiparams.V;   %#ok&lt;NASGU&gt;</span>
1085 <span class="comment">% Map = guiparams.Map; %#ok&lt;NASGU&gt;</span>
1086 
1087 <span class="comment">% Compute multibeam bathymetry:</span>
1088 <span class="comment">% -----------------------------</span>
1089 msgbox(<span class="string">'Processing Bathymetry...Please Be Patient'</span>,<span class="string">'VMT Status'</span>,<span class="string">'help'</span>,<span class="string">'replace'</span>)
1090 <span class="comment">%A = VMT_MBBathy(z,A,savefile,handles.beam_angle,handles.MagneticVariation,handles.WSE);</span>
1091 <a href="VMT_MBBathy.html" class="code" title="function [A] = VMT_MBBathy(z,A,savefile,beamAng,magVar,wsedata,saveaux)">VMT_MBBathy</a>(z,A,savefile, <span class="keyword">...</span>
1092     guiparams.beam_angle, <span class="keyword">...</span>
1093     guiparams.magnetic_variation, <span class="keyword">...</span>
1094     guiparams.wse, <span class="keyword">...</span>
1095     guiparams.output_auxiliary_data);
1096 
1097 msgbox(<span class="string">'Bathymetry Output Complete'</span>,<span class="string">'VMT Status'</span>,<span class="string">'help'</span>,<span class="string">'replace'</span>)
1098 
1099 <span class="comment">% [EOF] saveBathymetryCallback</span>
1100 
1101 <span class="comment">% --------------------------------------------------------------------</span>
1102 <a name="_sub46" href="#_subfunctions" class="code">function plottingParametersCallback(hObject, eventdata, handles)</a>
1103 
1104 <span class="comment">% Get the Application data:</span>
1105 <span class="comment">% -------------------------</span>
1106 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1107 
1108 [guiparams.english_units,guiparams.set_cross_section_endpoints,<span class="keyword">...</span>
1109     guiparams.presentation,guiparams.print] = <span class="keyword">...</span>
1110     plotParametersDialog(guiparams.english_units, <span class="keyword">...</span>
1111     guiparams.set_cross_section_endpoints,<span class="keyword">...</span>
1112     guiparams.presentation,guiparams.print,<span class="keyword">...</span>
1113     handles.figure1);
1114 
1115 <span class="comment">% Update the GUI:</span>
1116 <span class="comment">% ---------------</span>
1117 <span class="keyword">if</span> guiparams.english_units
1118     set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
1119     set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
1120 <span class="keyword">else</span>
1121     set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
1122     set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
1123 <span class="keyword">end</span>
1124 
1125 <span class="keyword">if</span> guiparams.set_cross_section_endpoints
1126     set(handles.menuCrossSectionEndpointAutomatic,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
1127     set(handles.menuCrossSectionEndpointManual,   <span class="string">'Checked'</span>,<span class="string">'on'</span>)
1128 <span class="keyword">else</span>
1129     set(handles.menuCrossSectionEndpointAutomatic,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
1130     set(handles.menuCrossSectionEndpointManual,   <span class="string">'Checked'</span>,<span class="string">'off'</span>)
1131 <span class="keyword">end</span>
1132 
1133 <span class="keyword">if</span> guiparams.presentation
1134     <a href="#_sub31" class="code" title="subfunction menuStylePresentation_Callback(hObject, eventdata, handles)">menuStylePresentation_Callback</a>(hObject, eventdata, handles)
1135 <span class="comment">%     set(handles.menuStylePrint,           'Checked','off')</span>
1136 <span class="comment">%     set(handles.menuStylePresentation,    'Checked','on')</span>
1137 <span class="comment">%     set(handles.menuPrintFormat,          'Checked','off')</span>
1138 <span class="comment">%     set(handles.menuPresentationFormat,   'Checked','on')</span>
1139 <span class="keyword">else</span>
1140     <a href="#_sub30" class="code" title="subfunction menuStylePrint_Callback(hObject, eventdata, handles)">menuStylePrint_Callback</a>(hObject, eventdata, handles)
1141 <span class="comment">%     set(handles.menuStylePrint,           'Checked','on')</span>
1142 <span class="comment">%     set(handles.menuStylePresentation,    'Checked','off')</span>
1143 <span class="comment">%     set(handles.menuPrintFormat,          'Checked','on')</span>
1144 <span class="comment">%     set(handles.menuPresentationFormat,   'Checked','off')</span>
1145 <span class="keyword">end</span>
1146 
1147 <span class="comment">% Re-store the Application data:</span>
1148 <span class="comment">% ------------------------------</span>
1149 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1150 
1151 <span class="comment">% [EOF] plottingParametersCallback</span>
1152 
1153 
1154 <span class="comment">% --------------------------------------------------------------------</span>
1155 <a name="_sub47" href="#_subfunctions" class="code">function processingParametersCallback(hObject, eventdata, handles)</a>
1156 
1157 <span class="comment">% Get the Application data:</span>
1158 <span class="comment">% -------------------------</span>
1159 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1160 z   = guiparams.z;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1161 A   = guiparams.A;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1162 V   = guiparams.V;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1163 Map = guiparams.Map; <span class="comment">%#ok&lt;NASGU&gt;</span>
1164 
1165 <span class="comment">% [EOF] processingParametersCallback</span>
1166 
1167 
1168 <span class="comment">% --------------------------------------------------------------------</span>
1169 <a name="_sub48" href="#_subfunctions" class="code">function shiptracksPlotCallback(hObject, eventdata, handles)</a>
1170 <span class="comment">% Plot 1</span>
1171 
1172 <span class="comment">% Get the Application data:</span>
1173 <span class="comment">% -------------------------</span>
1174 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1175 z = guiparams.z;
1176 A = guiparams.A;
1177 V = guiparams.V; <span class="comment">%#ok&lt;NASGU&gt;</span>
1178 <span class="comment">% Map = guiparams.Map;</span>
1179 setends = guiparams.set_cross_section_endpoints;
1180 
1181 <span class="comment">% Process the transects:</span>
1182 <span class="comment">% ----------------------</span>
1183 A(1).hgns = guiparams.horizontal_grid_node_spacing;
1184 A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
1185 [A,V,processing_log_text] = <a href="VMT_ProcessTransects.html" class="code" title="function [A,V,log_text] = VMT_ProcessTransects(z,A,setends)">VMT_ProcessTransects</a>(z,A,guiparams.set_cross_section_endpoints);
1186 
1187 <span class="comment">% Push messages to Log Window:</span>
1188 <span class="comment">% ----------------------------</span>
1189 log_text = {<span class="string">'Plotting Shiptracks (reprocessing)'</span>};
1190 statusLogging(handles.LogWindow, vertcat(log_text,processing_log_text))
1191 
1192 <span class="comment">% Create or replot the Shiptracks</span>
1193 <span class="comment">% -------------------------------</span>
1194 <span class="comment">% Grab the axes to the plot</span>
1195 <span class="comment">% axes(handles.Plot1Shiptracks);</span>
1196 <a href="VMT_PlotShiptracks.html" class="code" title="function hf = VMT_PlotShiptracks(A,V,z,setends,hf)">VMT_PlotShiptracks</a>(A,V,z,setends,handles.Plot1Shiptracks); <span class="comment">% PLOT 1</span>
1197 
1198 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1199 <span class="comment">% New plot display window</span>
1200 <span class="comment">% h = VMT_CreatePlotDisplay('shiptracks');</span>
1201 <span class="comment">% h = figure(1); clf</span>
1202 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1203 
1204 <span class="comment">% [EOF] shiptracksPlotCallback</span>
1205 
1206 
1207 <span class="comment">% --------------------------------------------------------------------</span>
1208 <a name="_sub49" href="#_subfunctions" class="code">function planviewPlotCallback(hObject, eventdata, handles)</a>
1209 <span class="comment">% Plot 2</span>
1210 
1211 <span class="comment">% Get the Application data:</span>
1212 <span class="comment">% -------------------------</span>
1213 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1214 
1215 <span class="keyword">if</span> iscell(guiparams.mat_file) <span class="comment">% Multiple MAT files loaded</span>
1216     <span class="comment">% Push messages to Log Window:</span>
1217     <span class="comment">% ----------------------------</span>
1218     log_text = {<span class="string">'Plotting Multiple Transects (Planview)'</span>};
1219     statusLogging(handles.LogWindow, log_text)
1220     
1221        
1222     <span class="comment">% Push plotting parameters to log window:</span>
1223     <span class="comment">% ---------------------------------------</span>
1224     log_text = {<span class="keyword">...</span>
1225         <span class="string">'Plan View Plotting Parameters'</span>;<span class="keyword">...</span>
1226         sprintf(<span class="string">'   Depth range %3.1f to %3.1f m'</span>,guiparams.depth_range_min, guiparams.depth_range_max);<span class="keyword">...</span>
1227         sprintf(<span class="string">'   Vector scale: %d'</span>,guiparams.vector_scale_plan_view);<span class="keyword">...</span>
1228         sprintf(<span class="string">'   Vector spacing: %d'</span>,guiparams.vector_spacing_plan_view);<span class="keyword">...</span>
1229         sprintf(<span class="string">'   Smoothing window size: %d'</span>,guiparams.smoothing_window_size);<span class="keyword">...</span>
1230         };
1231     statusLogging(handles.LogWindow, log_text)
1232     
1233     <span class="comment">% Plot the data:</span>
1234     <span class="comment">% --------------</span>
1235     z = [];
1236     A = [];
1237     V = [];
1238     Map = [];
1239     depth_range = [guiparams.depth_range_min guiparams.depth_range_max];
1240     [PVdata,~,log_text] = <a href="VMT_PlotPlanViewQuivers.html" class="code" title="function [PVdata,fig_planview_handle,log_text] = VMT_PlotPlanViewQuivers(z,A,V,Map,drng,ascale,QuiverSpacing,pvsmwin,pshore,plot_english,varargin)">VMT_PlotPlanViewQuivers</a>(z,A,V,Map, <span class="keyword">...</span>
1241         depth_range, <span class="keyword">...</span>
1242         guiparams.vector_scale_plan_view, <span class="keyword">...</span>
1243         guiparams.vector_spacing_plan_view, <span class="keyword">...</span>
1244         guiparams.smoothing_window_size, <span class="keyword">...</span>
1245         guiparams.display_shoreline, <span class="keyword">...</span>
1246         guiparams.english_units, <span class="keyword">...</span>
1247         guiparams.mat_file, <span class="keyword">...</span>
1248         guiparams.mat_path); <span class="comment">% PLOT2</span>
1249     statusLogging(handles.LogWindow, log_text)
1250     
1251     <span class="comment">% Plot a Shoreline Map:</span>
1252     <span class="comment">% ---------------------</span>
1253     <span class="keyword">if</span> guiparams.display_shoreline
1254         Map = <a href="VMT_LoadMap.html" class="code" title="function Map = VMT_LoadMap(filetype,coord);">VMT_LoadMap</a>(<span class="string">'txt'</span>,<span class="string">'UTM'</span>);
1255         <span class="comment">%figure(2); clf</span>
1256         <a href="VMT_PlotShoreline.html" class="code" title="function VMT_PlotShoreline(Map)">VMT_PlotShoreline</a>(Map)
1257         log_text = {<span class="keyword">...</span>
1258             <span class="string">'   Loading map file.'</span>;<span class="keyword">...</span>
1259             <span class="string">'   Plotting shoreline.'</span><span class="keyword">...</span>
1260             };
1261         statusLogging(handles.LogWindow, log_text)
1262     <span class="keyword">else</span>
1263         Map = [];
1264     <span class="keyword">end</span>
1265     
1266 <span class="keyword">else</span>
1267     z = guiparams.z;
1268     A = guiparams.A;
1269     <span class="comment">% V = guiparams.V;</span>
1270     Map = guiparams.Map;
1271     
1272     <span class="comment">% Push messages to Log Window:</span>
1273     <span class="comment">% ----------------------------</span>
1274     log_text = {<span class="string">'Plotting Depth Averaged Vectors (reprocessing)'</span>};
1275     statusLogging(handles.LogWindow, log_text)
1276     
1277         
1278     <span class="comment">% Preprocess the data:</span>
1279     <span class="comment">% --------------------</span>
1280     A = <a href="VMT_PreProcess.html" class="code" title="function A = VMT_PreProcess(z,A)">VMT_PreProcess</a>(z,A);
1281     
1282     <span class="comment">% Process the transects:</span>
1283     <span class="comment">% ----------------------</span>
1284     A(1).hgns = guiparams.horizontal_grid_node_spacing;
1285     A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
1286     [A,V,processing_log_text] = <a href="VMT_ProcessTransects.html" class="code" title="function [A,V,log_text] = VMT_ProcessTransects(z,A,setends)">VMT_ProcessTransects</a>(z,A,guiparams.set_cross_section_endpoints);
1287     
1288     <span class="comment">% Push messages to Log Window:</span>
1289     <span class="comment">% ----------------------------</span>
1290     statusLogging(handles.LogWindow, processing_log_text)
1291     
1292     <span class="comment">% Plot the cross section:</span>
1293     <span class="comment">% -----------------------</span>
1294     log_text = {<span class="keyword">...</span>
1295         <span class="string">'Plan View Plotting Parameters'</span>;<span class="keyword">...</span>
1296         sprintf(<span class="string">'   Depth range %3.1f to %3.1f m'</span>,guiparams.depth_range_min, guiparams.depth_range_max);<span class="keyword">...</span>
1297         sprintf(<span class="string">'   Vector scale: %d'</span>,guiparams.vector_scale_plan_view);<span class="keyword">...</span>
1298         sprintf(<span class="string">'   Vector spacing: %d'</span>,guiparams.vector_spacing_plan_view);<span class="keyword">...</span>
1299         sprintf(<span class="string">'   Smoothing window size: %d'</span>,guiparams.smoothing_window_size);<span class="keyword">...</span>
1300         };
1301     statusLogging(handles.LogWindow, log_text)
1302     
1303     <span class="comment">% Plot the data:</span>
1304     <span class="comment">% --------------</span>
1305     <span class="comment">%msgbox('Plotting Plan View','VMT Status','help','replace');</span>
1306     depth_range = [guiparams.depth_range_min guiparams.depth_range_max];
1307     <span class="comment">% if ~guiparams.map_depth_averaged_velocities</span>
1308     
1309     [PVdata,~,log_text] = <a href="VMT_PlotPlanViewQuivers.html" class="code" title="function [PVdata,fig_planview_handle,log_text] = VMT_PlotPlanViewQuivers(z,A,V,Map,drng,ascale,QuiverSpacing,pvsmwin,pshore,plot_english,varargin)">VMT_PlotPlanViewQuivers</a>(z,A,V,Map, <span class="keyword">...</span>
1310         depth_range, <span class="keyword">...</span>
1311         guiparams.vector_scale_plan_view, <span class="keyword">...</span>
1312         guiparams.vector_spacing_plan_view, <span class="keyword">...</span>
1313         guiparams.smoothing_window_size, <span class="keyword">...</span>
1314         guiparams.display_shoreline, <span class="keyword">...</span>
1315         guiparams.english_units); <span class="comment">% PLOT2</span>
1316     statusLogging(handles.LogWindow, log_text)
1317     
1318     <span class="comment">% Plot a Shoreline Map:</span>
1319     <span class="comment">% ---------------------</span>
1320     <span class="keyword">if</span> guiparams.display_shoreline
1321         Map = <a href="VMT_LoadMap.html" class="code" title="function Map = VMT_LoadMap(filetype,coord);">VMT_LoadMap</a>(<span class="string">'txt'</span>,<span class="string">'UTM'</span>);
1322         <span class="comment">%figure(2); clf</span>
1323         <a href="VMT_PlotShoreline.html" class="code" title="function VMT_PlotShoreline(Map)">VMT_PlotShoreline</a>(Map)
1324         log_text = {<span class="keyword">...</span>
1325             <span class="string">'   Loading map file.'</span>;<span class="keyword">...</span>
1326             <span class="string">'   Plotting shoreline.'</span><span class="keyword">...</span>
1327             };
1328         statusLogging(handles.LogWindow, log_text)
1329     <span class="keyword">else</span>
1330         Map = [];
1331     <span class="keyword">end</span>
1332     
1333 <span class="keyword">end</span>
1334 
1335 <span class="keyword">if</span> guiparams.add_background
1336     log_text = <a href="VMT_OverlayDOQQ.html" class="code" title="function log_text = VMT_OverlayDOQQ(pathname)">VMT_OverlayDOQQ</a>(guiparams.data_folder);
1337     statusLogging(handles.LogWindow, log_text)
1338 <span class="keyword">end</span>
1339 
1340 <span class="comment">% Save the PVdata to persistent guiparams</span>
1341 <span class="comment">% ---------------------------------------</span>
1342 guiparams.iric_anv_planview_data = PVdata;
1343 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams);
1344 
1345 <span class="comment">% Force plot to be formated properly</span>
1346 <span class="comment">% ----------------------------------</span>
1347 <span class="keyword">if</span> guiparams.presentation
1348     <a href="#_sub31" class="code" title="subfunction menuStylePresentation_Callback(hObject, eventdata, handles)">menuStylePresentation_Callback</a>(hObject, eventdata, handles)
1349 <span class="keyword">else</span>
1350     <a href="#_sub30" class="code" title="subfunction menuStylePrint_Callback(hObject, eventdata, handles)">menuStylePrint_Callback</a>(hObject, eventdata, handles)
1351 <span class="keyword">end</span>
1352 
1353 <span class="comment">% [EOF] planviewPlotCallback</span>
1354 
1355 
1356 <span class="comment">% --------------------------------------------------------------------</span>
1357 <a name="_sub50" href="#_subfunctions" class="code">function crosssectionPlotCallback(hObject, eventdata, handles)</a>
1358 <span class="comment">% Plot 3</span>
1359 
1360 <span class="comment">% Get the Application data:</span>
1361 <span class="comment">% -------------------------</span>
1362 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1363 z = guiparams.z;
1364 A = guiparams.A;
1365 <span class="comment">% V = guiparams.V;</span>
1366 <span class="comment">% Map = guiparams.Map;</span>
1367 
1368 <span class="comment">% Preprocess the data:</span>
1369 <span class="comment">% --------------------</span>
1370 A = <a href="VMT_PreProcess.html" class="code" title="function A = VMT_PreProcess(z,A)">VMT_PreProcess</a>(z,A);
1371 
1372 <span class="comment">% Push messages to Log Window:</span>
1373 <span class="comment">% ----------------------------</span>
1374 log_text = {<span class="string">'Plotting Cross Section (reprocessing)'</span>};
1375 statusLogging(handles.LogWindow, log_text)
1376 
1377 <span class="comment">% Process the transects:</span>
1378 <span class="comment">% ----------------------</span>
1379 A(1).hgns = guiparams.horizontal_grid_node_spacing;
1380 A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
1381 [A,V,processing_log_text] = <a href="VMT_ProcessTransects.html" class="code" title="function [A,V,log_text] = VMT_ProcessTransects(z,A,setends)">VMT_ProcessTransects</a>(z,A,guiparams.set_cross_section_endpoints);
1382 
1383 <span class="comment">% Push messages to Log Window:</span>
1384 <span class="comment">% ----------------------------</span>
1385 statusLogging(handles.LogWindow, processing_log_text)
1386 
1387 <span class="comment">% Plot the cross section:</span>
1388 <span class="comment">% -----------------------</span>
1389 log_text = {<span class="keyword">...</span>
1390     <span class="string">'Cross Section Plotting Parameters'</span>;<span class="keyword">...</span>
1391     sprintf(<span class="string">'   Contour variable: %s'</span>          ,guiparams.contours(guiparams.idx_contour).string);<span class="keyword">...</span>
1392     sprintf(<span class="string">'   Vertical exaggeration: %d'</span>     ,guiparams.vertical_exaggeration);<span class="keyword">...</span>
1393     sprintf(<span class="string">'   Vector scale: %3.1f'</span>           ,guiparams.vector_scale_cross_section);<span class="keyword">...</span>
1394     sprintf(<span class="string">'   Horizontal vector spacing: %d'</span> ,guiparams.horizontal_vector_spacing);<span class="keyword">...</span>
1395     sprintf(<span class="string">'   Vertical vector spacing: %d'</span>   ,guiparams.vertical_vector_spacing);<span class="keyword">...</span>
1396     sprintf(<span class="string">'   Horizontal smooting window: %d'</span>,guiparams.horizontal_smoothing_window);<span class="keyword">...</span>
1397     sprintf(<span class="string">'   Vertical smoothing window: %d'</span> ,guiparams.vertical_smoothing_window);<span class="keyword">...</span>
1398     };
1399 <span class="keyword">if</span> guiparams.plot_secondary_flow_vectors
1400     log_text = vertcat(log_text, {<span class="keyword">...</span>
1401         sprintf(<span class="string">'   Vector variable: %s'</span>,guiparams.secondary_flows(guiparams.idx_secondary_flow_vector_variable).string);<span class="keyword">...</span>
1402         sprintf(<span class="string">'   Inc. vertical component?: %d'</span>,guiparams.include_vertical_velocity)<span class="keyword">...</span>
1403         });
1404 <span class="keyword">end</span>
1405 <span class="comment">% Push messages to Log Window:</span>
1406 <span class="comment">% ----------------------------</span>
1407 statusLogging(handles.LogWindow, log_text)
1408 
1409 <span class="keyword">if</span> guiparams.plot_secondary_flow_vectors
1410     <span class="comment">%msgbox('Plotting Cross Section','VMT Status','help','replace')</span>
1411     V = <a href="VMT_SmoothVar.html" class="code" title="function [V] = VMT_SmoothVar(V,hwin,vwin)">VMT_SmoothVar</a>(V, <span class="keyword">...</span>
1412         <span class="keyword">...</span><span class="comment">guiparams.contour, ...</span>
1413         guiparams.horizontal_smoothing_window, <span class="keyword">...</span>
1414         guiparams.vertical_smoothing_window);
1415     V = <a href="VMT_SmoothVar.html" class="code" title="function [V] = VMT_SmoothVar(V,hwin,vwin)">VMT_SmoothVar</a>(V, <span class="keyword">...</span>
1416         <span class="keyword">...</span><span class="comment">guiparams.secondary_flow_vector_variable, ...</span>
1417         guiparams.horizontal_smoothing_window, <span class="keyword">...</span>
1418         guiparams.vertical_smoothing_window);
1419     [~,A,V,plot_cont_log_text] = <a href="VMT_PlotXSContQuiver.html" class="code" title="function [z,A,V,log_text] = VMT_PlotXSContQuiver(z,A,V,var,sf,exag,qspchorz,qspcvert,secvecvar,vvelcomp,plot_english)">VMT_PlotXSContQuiver</a>(z,A,V, <span class="keyword">...</span>
1420         guiparams.contour, <span class="keyword">...</span>
1421         guiparams.vector_scale_cross_section, <span class="keyword">...</span>
1422         guiparams.vertical_exaggeration, <span class="keyword">...</span>
1423         guiparams.horizontal_vector_spacing, <span class="keyword">...</span>
1424         guiparams.vertical_vector_spacing, <span class="keyword">...</span>
1425         guiparams.secondary_flow_vector_variable, <span class="keyword">...</span>
1426         guiparams.include_vertical_velocity, <span class="keyword">...</span>
1427         guiparams.english_units); <span class="comment">%#ok&lt;ASGLU&gt; % PLOT3</span>
1428     
1429 <span class="keyword">elseif</span> ~guiparams.plot_secondary_flow_vectors
1430     V = <a href="VMT_SmoothVar.html" class="code" title="function [V] = VMT_SmoothVar(V,hwin,vwin)">VMT_SmoothVar</a>(V, <span class="keyword">...</span>
1431         <span class="keyword">...</span><span class="comment">guiparams.contour, ...</span>
1432         guiparams.horizontal_smoothing_window, <span class="keyword">...</span>
1433         guiparams.vertical_smoothing_window);
1434     
1435     [~,A,V,zmin,zmax,plot_cont_log_text] = <a href="VMT_PlotXSCont.html" class="code" title="function [z,A,V,zmin,zmax,log_text,fig_contour_handle] = VMT_PlotXSCont(z,A,V,var,exag,plot_english)">VMT_PlotXSCont</a>(z,A,V, <span class="keyword">...</span>
1436         guiparams.contour, <span class="keyword">...</span>
1437         guiparams.vertical_exaggeration, <span class="keyword">...</span>
1438         guiparams.english_units);  <span class="comment">%#ok&lt;ASGLU&gt;</span>
1439     
1440     guiparams.zmin = zmin;
1441     guiparams.zmax = zmax;
1442     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1443 <span class="keyword">end</span>
1444 
1445 <span class="comment">% Force plot to be formated properly</span>
1446 <span class="comment">% ----------------------------------</span>
1447 <span class="keyword">if</span> guiparams.presentation
1448     <a href="#_sub31" class="code" title="subfunction menuStylePresentation_Callback(hObject, eventdata, handles)">menuStylePresentation_Callback</a>(hObject, eventdata, handles)
1449 <span class="keyword">else</span>
1450     <a href="#_sub30" class="code" title="subfunction menuStylePrint_Callback(hObject, eventdata, handles)">menuStylePrint_Callback</a>(hObject, eventdata, handles)
1451 <span class="keyword">end</span>
1452 
1453 <span class="comment">% Push messages to Log Window:</span>
1454 <span class="comment">% ----------------------------</span>
1455 statusLogging(handles.LogWindow, plot_cont_log_text)
1456 <span class="comment">% msgbox('Plotting Complete','VMT Status','help','replace')</span>
1457 
1458 <span class="comment">% [EOF] crosssectionPlotCallback</span>
1459 
1460 
1461 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1462 <span class="comment">% DATA EXPORT CALLBACKS %</span>
1463 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1464 
1465 <span class="comment">% --------------------------------------------------------------------</span>
1466 <a name="_sub51" href="#_subfunctions" class="code">function SaveMATFile_Callback(hObject, eventdata, handles)</a>
1467 <span class="comment">% saveDataCallback(hObject, eventdata, handles)</span>
1468 
1469 <span class="comment">% Get the Application data:</span>
1470 <span class="comment">% -------------------------</span>
1471 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1472 z   = guiparams.z;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1473 A   = guiparams.A;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1474 V   = guiparams.V;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1475 Map = guiparams.Map; <span class="comment">%#ok&lt;NASGU&gt;</span>
1476 
1477 [the_file,the_path] = <span class="keyword">...</span>
1478     uiputfile({<span class="string">'*.mat'</span>,<span class="string">'MAT-Files (*.mat)'</span>}, <span class="keyword">...</span>
1479     <span class="string">'Save MAT-File'</span>, <span class="keyword">...</span>
1480     fullfile(guiparams.mat_path,guiparams.savefile));
1481 
1482 <span class="comment">% Save the processed data to a MAT file:</span>
1483 <span class="comment">% --------------------------------------</span>
1484 <span class="keyword">if</span> ischar(the_file)
1485     guiparams.mat_path = the_path;
1486     guiparams.mat_file = the_file;
1487     guiparams.savefile = the_file;
1488     
1489     <span class="comment">% Re-store the Application data:</span>
1490     <span class="comment">% ------------------------------</span>
1491     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1492     
1493     <span class="comment">% Update the preferences:</span>
1494     <span class="comment">% -----------------------</span>
1495     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1496     guiprefs.mat_path = the_path;
1497     guiprefs.mat_file = the_file;
1498     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
1499     <a href="#_sub86" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'mat'</span>)
1500     
1501     [~,filename,extension] = fileparts(guiparams.savefile);
1502     savefile = [filename extension];
1503     h = msgbox([<span class="string">'Saving processed data in MAT File '''</span> savefile <span class="string">''''</span>], <span class="keyword">...</span>
1504         <span class="string">'Saving Processed Data File...'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
1505     disp(<span class="string">'Saving Processed Data File...'</span>)
1506     disp(savefile)
1507     save(savefile,<span class="string">'A'</span>,<span class="string">'V'</span>,<span class="string">'z'</span>,<span class="string">'Map'</span>)
1508 <span class="keyword">end</span>
1509 
1510 <span class="comment">% [EOF] SaveMATFile_Callback</span>
1511 
1512 
1513 <span class="comment">% --------------------------------------------------------------------</span>
1514 <a name="_sub52" href="#_subfunctions" class="code">function SaveTecplotFile_Callback(hObject, eventdata, handles)</a>
1515 
1516 <span class="comment">% Get the Application data:</span>
1517 <span class="comment">% -------------------------</span>
1518 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1519 <span class="comment">% z   = guiparams.z;</span>
1520 <span class="comment">% A   = guiparams.A;</span>
1521 V   = guiparams.V;
1522 <span class="comment">% Map = guiparams.Map;</span>
1523 
1524 [the_file,the_path] = <span class="keyword">...</span>
1525     uiputfile({<span class="string">'*.dat'</span>,<span class="string">'Tecplot Files (*.dat)'</span>}, <span class="keyword">...</span>
1526     <span class="string">'Save Tecplot File'</span>, <span class="keyword">...</span>
1527     fullfile(guiparams.tecplot_path,guiparams.tecplot_file));
1528 
1529 <span class="comment">% Output the data (no smoothing) to Tecplot:</span>
1530 <span class="comment">% ------------------------------------------</span>
1531 <span class="keyword">if</span> ischar(the_file)
1532     guiparams.tecplot_path = the_path;
1533     guiparams.tecplot_file = the_file;
1534     
1535     <span class="comment">% Re-store the Application data:</span>
1536     <span class="comment">% ------------------------------</span>
1537     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1538     
1539     <span class="comment">% Update the preferences:</span>
1540     <span class="comment">% -----------------------</span>
1541     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1542     guiprefs.tecplot_path = the_path;
1543     guiprefs.tecplot_file = the_file;
1544     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
1545     <a href="#_sub86" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'tecplot'</span>)
1546     
1547     <span class="comment">% Push to log window</span>
1548     <span class="comment">% ------------------</span>
1549     log_text = {<span class="keyword">...</span>
1550         <span class="string">'Exporting Data to Tecplot (*.dat) File...'</span>;<span class="keyword">...</span>
1551         <span class="string">'Directory:'</span>;<span class="keyword">...</span>
1552         the_path;<span class="keyword">...</span>
1553         [<span class="string">'Filename: '</span> the_file]};
1554     statusLogging(handles.LogWindow,log_text)
1555         
1556     <span class="keyword">if</span> isempty(V)
1557         A = guiparams.A;
1558         A(1).hgns = guiparams.horizontal_grid_node_spacing;
1559         A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
1560         [~,V] = VMT_ProcessTransectsV3_new(guiparams.z, <span class="keyword">...</span>
1561             A, <span class="keyword">...</span>
1562             guiparams.set_cross_section_endpoints);
1563     <span class="keyword">end</span>
1564     <a href="VMT_BuildTecplotFile.html" class="code" title="function VMT_BuildTecplotFile(V,savefile)">VMT_BuildTecplotFile</a>(V,fullfile(guiparams.tecplot_path,guiparams.tecplot_file));
1565     
1566     <span class="comment">% Push to log window</span>
1567     <span class="comment">% ------------------</span>
1568     log_text = {<span class="string">'Exporting XS Bathy Data to Tecplot (*.dat) File...'</span>};
1569     statusLogging(handles.LogWindow,log_text)
1570     
1571     <a href="VMT_BuildTecplotFile_XSBathy.html" class="code" title="function VMT_BuildTecplot_XSBathy(V,savefile)">VMT_BuildTecplotFile_XSBathy</a>(V,fullfile(guiparams.tecplot_path,guiparams.tecplot_file));
1572     
1573     <span class="comment">% Push to log window</span>
1574     <span class="comment">% ------------------</span>
1575     log_text = {<span class="string">'Tecplot Export Complete'</span>};
1576     statusLogging(handles.LogWindow,log_text)
1577    
1578 <span class="keyword">end</span>
1579 
1580 <span class="comment">% [EOF] SaveTechplotFile_Callback</span>
1581 
1582 
1583 <span class="comment">% --------------------------------------------------------------------</span>
1584 <a name="_sub53" href="#_subfunctions" class="code">function SaveGoogleEarthFile_Callback(hObject, eventdata, handles)</a>
1585 
1586 <span class="comment">% Get the Application data:</span>
1587 <span class="comment">% -------------------------</span>
1588 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1589 <span class="comment">% z   = guiparams.z;</span>
1590 A   = guiparams.A;
1591 V   = guiparams.V;
1592 Map = guiparams.Map; <span class="comment">%#ok&lt;NASGU&gt;</span>
1593 
1594 [the_file,the_path] = <span class="keyword">...</span>
1595     uiputfile({<span class="string">'*.kmz'</span>,<span class="string">'Google Earth Files (*.kmz)'</span>}, <span class="keyword">...</span>
1596     <span class="string">'Save Google Earth File'</span>, <span class="keyword">...</span>
1597     fullfile(guiparams.kmz_path,guiparams.kmz_file));
1598 
1599 <span class="comment">% Save the processed data to a Google Earth (KMZ) file:</span>
1600 <span class="comment">% -----------------------------------------------------</span>
1601 <span class="keyword">if</span> ischar(the_file)
1602     guiparams.kmz_path = the_path;
1603     guiparams.kmz_file = the_file;
1604     
1605     <span class="comment">% Re-store the Application data:</span>
1606     <span class="comment">% ------------------------------</span>
1607     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1608     
1609     <span class="comment">% Update the preferences:</span>
1610     <span class="comment">% -----------------------</span>
1611     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1612     guiprefs.kmz_path = the_path;
1613     guiprefs.kmz_file = the_file;
1614     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
1615     <a href="#_sub86" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'kmz'</span>)
1616     
1617     <span class="comment">%     if guiparams.display_shoreline</span>
1618     <span class="comment">%         VMT_Shoreline2GE_3D(A,Map, ...</span>
1619     <span class="comment">%                             guiparams.vertical_exaggeration, ...</span>
1620     <span class="comment">%                             guiparams.vertical_offset);</span>
1621     <span class="comment">%     end</span>
1622     <span class="keyword">if</span> isempty(V)
1623         A = guiparams.A;
1624         A(1).hgns = guiparams.horizontal_grid_node_spacing;
1625         A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
1626         [~,V] = VMT_ProcessTransectsV3_new(guiparams.z, <span class="keyword">...</span>
1627             A, <span class="keyword">...</span>
1628             guiparams.set_cross_section_endpoints);
1629     <span class="keyword">end</span>
1630     <a href="VMT_MeanXS2GE_3D.html" class="code" title="function VMT_MeanXS2GE_3D(A,V,pathstr,filestr,vscale,voffset)">VMT_MeanXS2GE_3D</a>(A,V,[], <span class="keyword">...</span>
1631         fullfile(guiparams.kmz_path,guiparams.kmz_file), <span class="keyword">...</span>
1632         guiparams.vertical_exaggeration, <span class="keyword">...</span>
1633         guiparams.vertical_offset);
1634 <span class="keyword">end</span>
1635 
1636 <span class="comment">% [EOF] SaveGoogleEarthFile_Callback</span>
1637 
1638 
1639 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1640 <span class="comment">% DATA EXPORT/BATHYMETRY CALLBACKS %</span>
1641 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1642 
1643 <span class="comment">% --------------------------------------------------------------------</span>
1644 <a name="_sub54" href="#_subfunctions" class="code">function ExportMultibeamBathymetry_Callback(hObject, eventdata, handles)</a>
1645 
1646 <span class="comment">% Get the Application data:</span>
1647 <span class="comment">% -------------------------</span>
1648 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1649 guiprefs  = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1650 
1651 [the_file,the_path] = <span class="keyword">...</span>
1652     uiputfile({<span class="string">'*.csv'</span>,<span class="string">'Multibeam Bathymetry Files (*.csv)'</span>}, <span class="keyword">...</span>
1653     <span class="string">'Export Multibeam Bathymetry'</span>, <span class="keyword">...</span>
1654     fullfile(guiprefs.multibeambathymetry_path, <span class="keyword">...</span>
1655     guiprefs.multibeambathymetry_file));
1656 
1657 <span class="keyword">if</span> ischar(the_file)
1658     guiparams.multibeambathymetry_path = the_path;
1659     guiparams.multibeambathymetry_file = the_file;
1660     
1661     <span class="comment">% Re-store the Application data:</span>
1662     <span class="comment">% ------------------------------</span>
1663     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1664     
1665     <span class="comment">% Update the preferences:</span>
1666     <span class="comment">% -----------------------</span>
1667     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1668     guiprefs.multibeambathymetry_path = the_path;
1669     guiprefs.multibeambathymetry_file = the_file;
1670     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
1671     <a href="#_sub86" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'multibeambathymetry'</span>)
1672     
1673     <span class="keyword">if</span> guiparams.output_auxiliary_data
1674     <span class="keyword">end</span>
1675     
1676     <span class="comment">%msgbox('Processing Bathymetry...Please Be Patient','VMT Status','help','replace')</span>
1677     
1678     savefile = fullfile(guiparams.multibeambathymetry_path, <span class="keyword">...</span>
1679         guiparams.multibeambathymetry_file);
1680     
1681     log_text = {<span class="string">'Multibeam bathymetry file saved to:'</span>;<span class="keyword">...</span>
1682         [<span class="string">'   '</span> savefile]};
1683     statusLogging(handles.LogWindow,log_text)
1684     
1685     <a href="VMT_MBBathy.html" class="code" title="function [A] = VMT_MBBathy(z,A,savefile,beamAng,magVar,wsedata,saveaux)">VMT_MBBathy</a>(guiparams.z, <span class="keyword">...</span>
1686         guiparams.A, <span class="keyword">...</span>
1687         savefile, <span class="keyword">...</span>
1688         guiparams.beam_angle, <span class="keyword">...</span>
1689         guiparams.magnetic_variation, <span class="keyword">...</span>
1690         guiparams.wse, <span class="keyword">...</span>
1691         guiparams.output_auxiliary_data);
1692     
1693     <span class="comment">%msgbox('Bathymetry Output Complete','VMT Status','help','replace')</span>
1694     
1695 <span class="keyword">end</span>
1696 
1697 <span class="comment">% [EOF] ExportMultibeamBathymetry_Callback</span>
1698 
1699 
1700 <span class="comment">% --------------------------------------------------------------------</span>
1701 <a name="_sub55" href="#_subfunctions" class="code">function BeamAngle_Callback(hObject, eventdata, handles)</a>
1702 <span class="comment">% Get the beam angle</span>
1703 
1704 <span class="comment">% Get the Application data:</span>
1705 <span class="comment">% -------------------------</span>
1706 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1707 
1708 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1709 <span class="comment">% ----------------------------------------------------------------</span>
1710 new_beam_angle = str2double(get(hObject,<span class="string">'String'</span>));
1711 is_a_number = ~isnan(new_beam_angle);
1712 is_positive = new_beam_angle&gt;=0;
1713 
1714 <span class="comment">% Modify the Application data:</span>
1715 <span class="comment">% ----------------------------</span>
1716 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1717     guiparams.beam_angle = new_beam_angle;
1718     
1719     <span class="comment">% Re-store the Application data:</span>
1720     <span class="comment">% ------------------------------</span>
1721     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1722     
1723 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1724     set(hObject,<span class="string">'String'</span>,guiparams.beam_angle)
1725 <span class="keyword">end</span>
1726 
1727 <span class="comment">% [EOF] BeamAngle_Callback</span>
1728 
1729 
1730 <span class="comment">% --------------------------------------------------------------------</span>
1731 <a name="_sub56" href="#_subfunctions" class="code">function MagneticVariation_Callback(hObject, eventdata, handles)</a>
1732 <span class="comment">% Get the Magnetic Variation</span>
1733 
1734 <span class="comment">% Get the Application data:</span>
1735 <span class="comment">% -------------------------</span>
1736 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1737 
1738 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1739 <span class="comment">% ----------------------------------------------------------------</span>
1740 new_magnetic_variation = str2double(get(hObject,<span class="string">'String'</span>));
1741 is_a_number = ~isnan(new_magnetic_variation);
1742 is_positive = new_magnetic_variation&gt;=0;
1743 
1744 <span class="comment">% Modify the Application data:</span>
1745 <span class="comment">% ----------------------------</span>
1746 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1747     guiparams.magnetic_variation = new_magnetic_variation;
1748     
1749     <span class="comment">% Re-store the Application data:</span>
1750     <span class="comment">% ------------------------------</span>
1751     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1752     
1753 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1754     set(hObject,<span class="string">'String'</span>,guiparams.magnetic_variation)
1755 <span class="keyword">end</span>
1756 
1757 <span class="comment">% [EOF] MagneticVariation_Callback</span>
1758 
1759 
1760 <span class="comment">% --------------------------------------------------------------------</span>
1761 <a name="_sub57" href="#_subfunctions" class="code">function WSE_Callback(hObject, eventdata, handles)</a>
1762 
1763 <span class="comment">% Get the Application data:</span>
1764 <span class="comment">% -------------------------</span>
1765 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1766 
1767 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1768 <span class="comment">% ----------------------------------------------------------------</span>
1769 new_wse = str2double(get(hObject,<span class="string">'String'</span>));
1770 is_a_number = ~isnan(new_wse);
1771 is_positive = new_wse&gt;=0;
1772 
1773 <span class="comment">% Modify the Application data:</span>
1774 <span class="comment">% ----------------------------</span>
1775 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1776     guiparams.wse = new_wse;
1777     
1778     <span class="comment">% Re-store the Application data:</span>
1779     <span class="comment">% ------------------------------</span>
1780     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1781     
1782 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1783     set(hObject,<span class="string">'String'</span>,guiparams.wse)
1784 <span class="keyword">end</span>
1785 
1786 <span class="comment">% [EOF] WSE_Callback</span>
1787 
1788 
1789 <span class="comment">% --------------------------------------------------------------------</span>
1790 <a name="_sub58" href="#_subfunctions" class="code">function OutputAuxiliaryData_Callback(hObject, eventdata, handles)</a>
1791 <span class="comment">% Bathymetry Auxillary Data</span>
1792 
1793 <span class="comment">% Get the Application data:</span>
1794 <span class="comment">% -------------------------</span>
1795 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1796 
1797 <span class="comment">% Modify the Application data:</span>
1798 <span class="comment">% ----------------------------</span>
1799 guiparams.output_auxiliary_data = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
1800 
1801 <span class="comment">% Re-store the Application data:</span>
1802 <span class="comment">% ------------------------------</span>
1803 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1804 
1805 <span class="comment">% [EOF] OutputAuxiliaryData_Callback</span>
1806 
1807 
1808 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1809 <span class="comment">% PLOTTING/PLAN VIEW PLOT CALLBACKS %</span>
1810 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1811 
1812 <span class="comment">% --------------------------------------------------------------------</span>
1813 <a name="_sub59" href="#_subfunctions" class="code">function DepthRangeMin_Callback(hObject, eventdata, handles)</a>
1814 
1815 <span class="comment">% Get the Application data:</span>
1816 <span class="comment">% -------------------------</span>
1817 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1818 
1819 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1820 <span class="comment">% ----------------------------------------------------------------</span>
1821 new_depth_range_min = str2double(get(hObject,<span class="string">'String'</span>));
1822 is_a_number = ~isnan(new_depth_range_min);
1823 is_positive = new_depth_range_min&gt;=0;
1824 
1825 <span class="comment">% Modify the Application data:</span>
1826 <span class="comment">% ----------------------------</span>
1827 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1828     guiparams.depth_range_min = new_depth_range_min;
1829     
1830     <span class="comment">% Re-store the Application data:</span>
1831     <span class="comment">% ------------------------------</span>
1832     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1833     
1834 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1835     set(hObject,<span class="string">'String'</span>,guiparams.depth_range_min)
1836 <span class="keyword">end</span>
1837 
1838 <span class="comment">% [EOF] DepthRangeMin_Callback</span>
1839 
1840 
1841 <span class="comment">% --------------------------------------------------------------------</span>
1842 <a name="_sub60" href="#_subfunctions" class="code">function DepthRangeMax_Callback(hObject, eventdata, handles)</a>
1843 
1844 <span class="comment">% Get the Application data:</span>
1845 <span class="comment">% -------------------------</span>
1846 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1847 
1848 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1849 <span class="comment">% ----------------------------------------------------------------</span>
1850 new_depth_range_max = str2double(get(hObject,<span class="string">'String'</span>));
1851 is_a_number = ~isnan(new_depth_range_max);
1852 is_positive = new_depth_range_max&gt;=0;
1853 
1854 <span class="comment">% Modify the Application data:</span>
1855 <span class="comment">% ----------------------------</span>
1856 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1857     guiparams.depth_range_max = new_depth_range_max;
1858     
1859     <span class="comment">% Re-store the Application data:</span>
1860     <span class="comment">% ------------------------------</span>
1861     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1862     
1863 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1864     set(hObject,<span class="string">'String'</span>,guiparams.depth_range_max)
1865 <span class="keyword">end</span>
1866 
1867 <span class="comment">% [EOF] DepthMax_Callback</span>
1868 
1869 
1870 <span class="comment">% --------------------------------------------------------------------</span>
1871 <a name="_sub61" href="#_subfunctions" class="code">function VectorScalePlanView_Callback(hObject, eventdata, handles)</a>
1872 <span class="comment">% Set quiver scale (contour)</span>
1873 
1874 <span class="comment">% Get the Application data:</span>
1875 <span class="comment">% -------------------------</span>
1876 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1877 
1878 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1879 <span class="comment">% ----------------------------------------------------------------</span>
1880 new_vector_scale_plan_view = str2double(get(hObject,<span class="string">'String'</span>));
1881 is_a_number = ~isnan(new_vector_scale_plan_view);
1882 is_positive = new_vector_scale_plan_view&gt;=0;
1883 
1884 <span class="comment">% Modify the Application data:</span>
1885 <span class="comment">% ----------------------------</span>
1886 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1887     guiparams.vector_scale_plan_view = round(new_vector_scale_plan_view);
1888     
1889     <span class="comment">% Re-store the Application data:</span>
1890     <span class="comment">% ------------------------------</span>
1891     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1892     
1893 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1894     set(hObject,<span class="string">'String'</span>,guiparams.vector_scale_plan_view)
1895 <span class="keyword">end</span>
1896 
1897 <span class="comment">% [EOF] VectorScalePlanView_Callback</span>
1898 
1899 
1900 <span class="comment">% --------------------------------------------------------------------</span>
1901 <a name="_sub62" href="#_subfunctions" class="code">function VectorSpacingPlanview_Callback(hObject, eventdata, handles)</a>
1902 <span class="comment">% Set quiver spacing (contour, horizontal)</span>
1903 
1904 <span class="comment">% Get the Application data:</span>
1905 <span class="comment">% -------------------------</span>
1906 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1907 
1908 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1909 <span class="comment">% ----------------------------------------------------------------</span>
1910 new_vector_spacing_plan_view = str2double(get(hObject,<span class="string">'String'</span>));
1911 is_a_number = ~isnan(new_vector_spacing_plan_view);
1912 is_positive = new_vector_spacing_plan_view&gt;=0;
1913 
1914 <span class="comment">% Modify the Application data:</span>
1915 <span class="comment">% ----------------------------</span>
1916 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1917     guiparams.vector_spacing_plan_view = round(new_vector_spacing_plan_view);
1918     
1919     <span class="comment">% Re-store the Application data:</span>
1920     <span class="comment">% ------------------------------</span>
1921     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1922     
1923 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1924     set(hObject,<span class="string">'String'</span>,guiparams.vector_spacing_plan_view)
1925 <span class="keyword">end</span>
1926 
1927 <span class="comment">% [EOF] VectorSpacingPlanview_Callback</span>
1928 
1929 
1930 <span class="comment">% --------------------------------------------------------------------</span>
1931 <a name="_sub63" href="#_subfunctions" class="code">function SmoothingWindowSize_Callback(hObject, eventdata, handles)</a>
1932 <span class="comment">% Plan View smoothing window size</span>
1933 
1934 <span class="comment">% Get the Application data:</span>
1935 <span class="comment">% -------------------------</span>
1936 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1937 
1938 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1939 <span class="comment">% ----------------------------------------------------------------</span>
1940 new_smoothing_window_size = str2double(get(hObject,<span class="string">'String'</span>));
1941 is_a_number = ~isnan(new_smoothing_window_size);
1942 is_positive = new_smoothing_window_size&gt;=0;
1943 
1944 <span class="comment">% Modify the Application data:</span>
1945 <span class="comment">% ----------------------------</span>
1946 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1947     guiparams.smoothing_window_size = round(new_smoothing_window_size);
1948     
1949     <span class="comment">% Re-store the Application data:</span>
1950     <span class="comment">% ------------------------------</span>
1951     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1952     
1953 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1954     set(hObject,<span class="string">'String'</span>,guiparams.smoothing_window_size)
1955 <span class="keyword">end</span>
1956 
1957 <span class="comment">% [EOF] SmoothingWindowSize_Callback</span>
1958 
1959 
1960 <span class="comment">% --------------------------------------------------------------------</span>
1961 <a name="_sub64" href="#_subfunctions" class="code">function MapDepthAveragedVelocities_Callback(hObject, eventdata, handles)</a>
1962 
1963 <span class="comment">% Get the Application data:</span>
1964 <span class="comment">% -------------------------</span>
1965 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1966 
1967 <span class="comment">% Modify the Application data:</span>
1968 <span class="comment">% ----------------------------</span>
1969 guiparams.map_depth_averaged_velocities = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
1970 
1971 <span class="comment">% Re-store the Application data:</span>
1972 <span class="comment">% ------------------------------</span>
1973 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1974 
1975 <span class="comment">% [EOF] MapDepthAveragedVelocities_Callback</span>
1976 
1977 
1978 <span class="comment">% --------------------------------------------------------------------</span>
1979 <a name="_sub65" href="#_subfunctions" class="code">function DisplayShoreline_Callback(hObject, eventdata, handles)</a>
1980 
1981 <span class="comment">% Get the Application data:</span>
1982 <span class="comment">% -------------------------</span>
1983 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1984 
1985 <span class="comment">% Modify the Application data:</span>
1986 <span class="comment">% ----------------------------</span>
1987 guiparams.display_shoreline = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
1988 
1989 <span class="comment">% Re-store the Application data:</span>
1990 <span class="comment">% ------------------------------</span>
1991 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1992 
1993 <span class="comment">% [EOF] DisplayShoreline_Callback</span>
1994 
1995 
1996 <span class="comment">% --------------------------------------------------------------------</span>
1997 <a name="_sub66" href="#_subfunctions" class="code">function AddBackground_Callback(hObject, eventdata, handles)</a>
1998 
1999 <span class="comment">% Get the Application data:</span>
2000 <span class="comment">% -------------------------</span>
2001 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2002 
2003 <span class="comment">% Modify the Application data:</span>
2004 <span class="comment">% ----------------------------</span>
2005 guiparams.add_background = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
2006 
2007 <span class="comment">% Re-store the Application data:</span>
2008 <span class="comment">% ------------------------------</span>
2009 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2010 
2011 <span class="comment">% [EOF] AddBackground_Callback</span>
2012 
2013 
2014 <span class="comment">% --------------------------------------------------------------------</span>
2015 <a name="_sub67" href="#_subfunctions" class="code">function PlotPlanView_Callback(hObject, eventdata, handles)</a>
2016 <a href="#_sub49" class="code" title="subfunction planviewPlotCallback(hObject, eventdata, handles)">planviewPlotCallback</a>(hObject, eventdata, handles)
2017 <span class="comment">% [EOF] PlotPlanView_Callback</span>
2018 
2019 
2020 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
2021 <span class="comment">% PLOTTING/SHIP TRACKS PLOT CALLBACKS %</span>
2022 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
2023 
2024 <span class="comment">% --------------------------------------------------------------------</span>
2025 <a name="_sub68" href="#_subfunctions" class="code">function HorizontalGridNodeSpacing_Callback(hObject, eventdata, handles)</a>
2026 <span class="comment">% Set the horizontal grid node spacing</span>
2027 
2028 <span class="comment">% Get the Application data:</span>
2029 <span class="comment">% -------------------------</span>
2030 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2031 
2032 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
2033 <span class="comment">% ----------------------------------------------------------------</span>
2034 new_horizontal_grid_node_spacing = str2double(get(hObject,<span class="string">'String'</span>));
2035 is_a_number = ~isnan(new_horizontal_grid_node_spacing);
2036 is_positive = new_horizontal_grid_node_spacing&gt;=0;
2037 
2038 <span class="comment">% Modify the Application data:</span>
2039 <span class="comment">% ----------------------------</span>
2040 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
2041     guiparams.horizontal_grid_node_spacing = round(new_horizontal_grid_node_spacing);
2042     
2043     <span class="comment">% Re-store the Application data:</span>
2044     <span class="comment">% ------------------------------</span>
2045     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2046     
2047 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
2048     set(hObject,<span class="string">'String'</span>,guiparams.horizontal_grid_node_spacing)
2049 <span class="keyword">end</span>
2050 
2051 <span class="comment">% [EOF] HorizontalGridNodeSpacing_Callback</span>
2052 
2053 
2054 <span class="comment">% --------------------------------------------------------------------</span>
2055 <a name="_sub69" href="#_subfunctions" class="code">function SetCrossSectionEndpoints_Callback(hObject, eventdata, handles)</a>
2056 <span class="comment">% Set the cross section endpoints manually</span>
2057 
2058 <span class="comment">% Get the Application data:</span>
2059 <span class="comment">% -------------------------</span>
2060 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2061 
2062 <span class="comment">% Modify the Application data:</span>
2063 <span class="comment">% ----------------------------</span>
2064 guiparams.set_cross_section_endpoints = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
2065 
2066 <span class="comment">% Re-store the Application data:</span>
2067 <span class="comment">% ------------------------------</span>
2068 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2069 
2070 <span class="comment">% [EOF] SetCrossSectionEndpoints_Callback</span>
2071 
2072 
2073 <span class="comment">% --------------------------------------------------------------------</span>
2074 <a name="_sub70" href="#_subfunctions" class="code">function PlotShiptracks_Callback(hObject, eventdata, handles)</a>
2075 <a href="#_sub48" class="code" title="subfunction shiptracksPlotCallback(hObject, eventdata, handles)">shiptracksPlotCallback</a>(hObject, eventdata, handles)
2076 <span class="comment">% [EOF] PlotShiptracks_Callback</span>
2077 
2078 
2079 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
2080 <span class="comment">% PLOTTING/CROSS SECTION PLOT CALLBACKS %</span>
2081 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
2082 
2083 <span class="comment">% --------------------------------------------------------------------</span>
2084 <a name="_sub71" href="#_subfunctions" class="code">function Contour_Callback(hObject, eventdata, handles)</a>
2085 
2086 <span class="comment">% Get the Application data:</span>
2087 <span class="comment">% -------------------------</span>
2088 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2089 
2090 <span class="comment">% Modify the Application data:</span>
2091 <span class="comment">% ----------------------------</span>
2092 idx_variable = get(hObject,<span class="string">'Value'</span>);
2093 guiparams.idx_contour = idx_variable;
2094 guiparams.contour = guiparams.contours(idx_variable).variable;
2095 
2096 <span class="comment">% Re-store the Application data:</span>
2097 <span class="comment">% ------------------------------</span>
2098 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2099 
2100 <span class="comment">% [EOF] Contour_Callback</span>
2101 
2102 
2103 <span class="comment">% --------------------------------------------------------------------</span>
2104 <a name="_sub72" href="#_subfunctions" class="code">function VerticalExaggeration_Callback(hObject, eventdata, handles)</a>
2105 <span class="comment">% Set vertical exaggeration</span>
2106 
2107 <span class="comment">% Get the Application data:</span>
2108 <span class="comment">% -------------------------</span>
2109 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2110 
2111 <span class="comment">% Modify the Application data:</span>
2112 <span class="comment">% ----------------------------</span>
2113 guiparams.vertical_exaggeration = str2double(get(hObject,<span class="string">'String'</span>));
2114 
2115 <span class="comment">% Re-store the Application data:</span>
2116 <span class="comment">% ------------------------------</span>
2117 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2118 
2119 <span class="comment">% Update the GUI:</span>
2120 <span class="comment">% ---------------</span>
2121 <span class="comment">% updateGUI(handles,guiparams)</span>
2122 
2123 <span class="comment">% [EOF] VerticalExaggeration_Callback</span>
2124 
2125 
2126 <span class="comment">% --------------------------------------------------------------------</span>
2127 <a name="_sub73" href="#_subfunctions" class="code">function VectorScaleCrossSection_Callback(hObject, eventdata, handles)</a>
2128 
2129 <span class="comment">% Get the Application data:</span>
2130 <span class="comment">% -------------------------</span>
2131 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2132 
2133 <span class="comment">% Modify the Application data:</span>
2134 <span class="comment">% ----------------------------</span>
2135 guiparams.vector_scale_cross_section = str2double(get(hObject,<span class="string">'String'</span>));
2136 
2137 <span class="comment">% Re-store the Application data:</span>
2138 <span class="comment">% ------------------------------</span>
2139 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2140 
2141 <span class="comment">% Update the GUI:</span>
2142 <span class="comment">% ---------------</span>
2143 <span class="comment">% updateGUI(handles,guiparams)</span>
2144 
2145 <span class="comment">% [EOF] VectorScaleCrossSection_Callback</span>
2146 
2147 
2148 <span class="comment">% --------------------------------------------------------------------</span>
2149 <a name="_sub74" href="#_subfunctions" class="code">function HorizontalVectorSpacing_Callback(hObject, eventdata, handles)</a>
2150 
2151 <span class="comment">% Get the Application data:</span>
2152 <span class="comment">% -------------------------</span>
2153 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2154 
2155 <span class="comment">% Modify the Application data:</span>
2156 <span class="comment">% ----------------------------</span>
2157 guiparams.horizontal_vector_spacing = str2double(get(hObject,<span class="string">'String'</span>));
2158 
2159 <span class="comment">% Re-store the Application data:</span>
2160 <span class="comment">% ------------------------------</span>
2161 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2162 
2163 <span class="comment">% Update the GUI:</span>
2164 <span class="comment">% ---------------</span>
2165 <span class="comment">% updateGUI(handles,guiparams)</span>
2166 
2167 <span class="comment">% [EOF] HorizontalVectorSpacing_Callback</span>
2168 
2169 
2170 <span class="comment">% --------------------------------------------------------------------</span>
2171 <a name="_sub75" href="#_subfunctions" class="code">function VerticalVectorSpacing_Callback(hObject, eventdata, handles)</a>
2172 <span class="comment">% Get the vertical quiver spacing for contour plots</span>
2173 
2174 <span class="comment">% Get the Application data:</span>
2175 <span class="comment">% -------------------------</span>
2176 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2177 
2178 <span class="comment">% Modify the Application data:</span>
2179 <span class="comment">% ----------------------------</span>
2180 guiparams.vertical_vector_spacing = str2double(get(hObject,<span class="string">'String'</span>));
2181 
2182 <span class="comment">% Re-store the Application data:</span>
2183 <span class="comment">% ------------------------------</span>
2184 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2185 
2186 <span class="comment">% Update the GUI:</span>
2187 <span class="comment">% ---------------</span>
2188 <span class="comment">% updateGUI(handles,guiparams)</span>
2189 
2190 <span class="comment">% [EOF] VerticalVectorSpacing_Callback</span>
2191 
2192 
2193 <span class="comment">% --------------------------------------------------------------------</span>
2194 <a name="_sub76" href="#_subfunctions" class="code">function HorizontalSmoothingWindow_Callback(hObject, eventdata, handles)</a>
2195 <span class="comment">% Horizontal Smoothing</span>
2196 
2197 <span class="comment">% Get the Application data:</span>
2198 <span class="comment">% -------------------------</span>
2199 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2200 
2201 <span class="comment">% Modify the Application data:</span>
2202 <span class="comment">% ----------------------------</span>
2203 guiparams.horizontal_smoothing_window = str2double(get(hObject,<span class="string">'String'</span>));
2204 
2205 <span class="comment">% Re-store the Application data:</span>
2206 <span class="comment">% ------------------------------</span>
2207 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2208 
2209 <span class="comment">% Update the GUI:</span>
2210 <span class="comment">% ---------------</span>
2211 <span class="comment">% updateGUI(handles,guiparams)</span>
2212 
2213 <span class="comment">% [EOF] HorizontalSmoothingWindow_Callback</span>
2214 
2215 
2216 <span class="comment">% --------------------------------------------------------------------</span>
2217 <a name="_sub77" href="#_subfunctions" class="code">function VerticalSmoothingWindow_Callback(hObject, eventdata, handles)</a>
2218 <span class="comment">% Vertical Smoothing</span>
2219 
2220 <span class="comment">% Get the Application data:</span>
2221 <span class="comment">% -------------------------</span>
2222 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2223 
2224 <span class="comment">% Modify the Application data:</span>
2225 <span class="comment">% ----------------------------</span>
2226 guiparams.vertical_smoothing_window = str2double(get(hObject,<span class="string">'String'</span>));
2227 
2228 <span class="comment">% Re-store the Application data:</span>
2229 <span class="comment">% ------------------------------</span>
2230 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2231 
2232 <span class="comment">% Update the GUI:</span>
2233 <span class="comment">% ---------------</span>
2234 <span class="comment">% updateGUI(handles,guiparams)</span>
2235 
2236 <span class="comment">% [EOF] VerticalSmoothingWindow_Callback</span>
2237 
2238 
2239 <span class="comment">% --------------------------------------------------------------------</span>
2240 <a name="_sub78" href="#_subfunctions" class="code">function PlotSecondaryFlowVectors_Callback(hObject, eventdata, handles)</a>
2241 
2242 <span class="comment">% Get the Application data:</span>
2243 <span class="comment">% -------------------------</span>
2244 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2245 
2246 <span class="comment">% Modify the Application data:</span>
2247 <span class="comment">% ----------------------------</span>
2248 guiparams.plot_secondary_flow_vectors = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
2249 
2250 <span class="comment">% Re-store the Application data:</span>
2251 <span class="comment">% ------------------------------</span>
2252 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2253 
2254 <span class="comment">% [EOF] PlotSecondaryFlowVectors_Callback</span>
2255 
2256 
2257 <span class="comment">% --------------------------------------------------------------------</span>
2258 <a name="_sub79" href="#_subfunctions" class="code">function SecondaryFlowVectorVariable_Callback(hObject, eventdata, handles)</a>
2259 
2260 <span class="comment">% Get the Application data:</span>
2261 <span class="comment">% -------------------------</span>
2262 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2263 
2264 <span class="comment">% Modify the Application data:</span>
2265 <span class="comment">% ----------------------------</span>
2266 idx_variable = get(hObject,<span class="string">'Value'</span>);
2267 guiparams.idx_secondary_flow_vector_variable = idx_variable;
2268 guiparams.secondary_flow_vector_variable = guiparams.secondary_flows(idx_variable).variable;
2269 
2270 <span class="comment">% Re-store the Application data:</span>
2271 <span class="comment">% ------------------------------</span>
2272 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2273 
2274 <span class="comment">% [EOF] SecondaryFlowVectorVariable_Callback</span>
2275 
2276 
2277 <span class="comment">% --------------------------------------------------------------------</span>
2278 <a name="_sub80" href="#_subfunctions" class="code">function IncludeVerticalVelocity_Callback(hObject, eventdata, handles)</a>
2279 
2280 <span class="comment">% Get the Application data:</span>
2281 <span class="comment">% -------------------------</span>
2282 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2283 
2284 <span class="comment">% Modify the Application data:</span>
2285 <span class="comment">% ----------------------------</span>
2286 guiparams.include_vertical_velocity = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
2287 
2288 <span class="comment">% Re-store the Application data:</span>
2289 <span class="comment">% ------------------------------</span>
2290 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2291 
2292 <span class="comment">% [EOF] IncludeVerticalVelocity_Callback</span>
2293 
2294 
2295 <span class="comment">% --------------------------------------------------------------------</span>
2296 <a name="_sub81" href="#_subfunctions" class="code">function PlotCrossSection_Callback(hObject, eventdata, handles)</a>
2297 <a href="#_sub50" class="code" title="subfunction crosssectionPlotCallback(hObject, eventdata, handles)">crosssectionPlotCallback</a>(hObject, eventdata, handles)
2298 <span class="comment">% [EOF] PlotCrossSection_Callback</span>
2299 
2300 
2301 <span class="comment">% --------------------------------------------------------------------</span>
2302 <a name="_sub82" href="#_subfunctions" class="code">function ClearLog_Callback(hObject, eventdata, handles)</a>
2303 set(handles.LogWindow,<span class="string">'string'</span>,<span class="string">''</span>)
2304 <span class="comment">% [EOF] ClearLog_Callback</span>
2305 
2306 <span class="comment">% --------------------------------------------------------------------</span>
2307 <a name="_sub83" href="#_subfunctions" class="code">function SaveLog_Callback(hObject, eventdata, handles)</a>
2308 
2309 <span class="comment">% Get the Application data:</span>
2310 <span class="comment">% -------------------------</span>
2311 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2312 guiprefs  = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
2313 <span class="comment">% z   = guiparams.z;   %#ok&lt;NASGU&gt;</span>
2314 <span class="comment">% A   = guiparams.A;   %#ok&lt;NASGU&gt;</span>
2315 <span class="comment">% V   = guiparams.V;   %#ok&lt;NASGU&gt;</span>
2316 <span class="comment">% Map = guiparams.Map; %#ok&lt;NASGU&gt;</span>
2317 
2318 [the_file,the_path] = <span class="keyword">...</span>
2319     uiputfile({<span class="string">'*.txt'</span>,<span class="string">'TXT-Files (*.txt)'</span>}, <span class="keyword">...</span>
2320     <span class="string">'Choose where to save the log file'</span>, <span class="keyword">...</span>
2321     fullfile(guiprefs.log_path,guiprefs.log_file));
2322 
2323 <span class="comment">% Save the log to a TXT file:</span>
2324 <span class="comment">% ---------------------------</span>
2325 <span class="keyword">if</span> ischar(the_file)
2326     guiparams.log_path = the_path;
2327     guiparams.log_file = the_file;
2328     <span class="comment">%guiparams.savefile = the_file;</span>
2329     
2330     <span class="comment">% Re-store the Application data:</span>
2331     <span class="comment">% ------------------------------</span>
2332     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2333     
2334     <span class="comment">% Update the preferences:</span>
2335     <span class="comment">% -----------------------</span>
2336     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
2337     guiprefs.log_path = the_path;
2338     guiprefs.log_file = the_file;
2339     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
2340     <a href="#_sub86" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'log'</span>)
2341     
2342     [~,filename,extension] = fileparts(the_file);
2343     savefile = [the_path filename extension];
2344     h = msgbox([<span class="string">'Saving log to: '''</span> savefile <span class="string">''''</span>], <span class="keyword">...</span>
2345         <span class="string">'Saving Log File...'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
2346     
2347     logfile = get(handles.LogWindow,<span class="string">'string'</span>);
2348     [nrows,~]= size(logfile);
2349     fid = fopen(savefile, <span class="string">'w'</span>);
2350     <span class="keyword">for</span> row=1:nrows
2351         fprintf(fid, <span class="string">'%s \n'</span>, logfile{row,:});
2352     <span class="keyword">end</span>
2353     fclose(fid);
2354 <span class="keyword">end</span>
2355 <span class="comment">% [EOF] SaveLog_Callback</span>
2356 
2357 <span class="comment">%%%%%%%%%%%%%%%%</span>
2358 <span class="comment">% SUBFUNCTIONS %</span>
2359 <span class="comment">%%%%%%%%%%%%%%%%</span>
2360 
2361 <span class="comment">% --------------------------------------------------------------------</span>
2362 <a name="_sub84" href="#_subfunctions" class="code">function handles = buildToolbar(handles)</a>
2363 
2364 icons = <a href="#_sub100" class="code" title="subfunction icons = getIcons">getIcons</a>;
2365 ht = uitoolbar(<span class="string">'Parent'</span>,handles.figure1);
2366 
2367 <span class="comment">% Load data</span>
2368 <span class="comment">% icon = imread('C:\Users\pfricker\Desktop\icons\file_open.png');</span>
2369 <span class="comment">% icon = double(icon)/(2^16-1);</span>
2370 <span class="comment">% icon(icon==0) = NaN;</span>
2371 handles.toolbarLoadData = <span class="keyword">...</span>
2372     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2373     <span class="string">'CData'</span>,        icons(1).data, <span class="keyword">...</span>
2374     <span class="string">'TooltipString'</span>,<span class="string">'Open ASCII File'</span>);
2375 
2376 <span class="comment">% Save data</span>
2377 <span class="comment">% icon = imread('C:\Users\pfricker\Desktop\icons\file_save.png');</span>
2378 <span class="comment">% icon = double(icon)/(2^16-1);</span>
2379 <span class="comment">% icon(icon==0) = NaN;</span>
2380 handles.toolbarSaveMatFile = <span class="keyword">...</span>
2381     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2382     <span class="string">'CData'</span>,        icons(2).data, <span class="keyword">...</span>
2383     <span class="string">'TooltipString'</span>,<span class="string">'Save MAT File'</span>, <span class="keyword">...</span>
2384     <span class="string">'Separator'</span>,    <span class="string">'on'</span>);
2385 
2386 
2387 <span class="comment">% Save bathymetry</span>
2388 <span class="comment">%icon = ones(16,16,3);</span>
2389 handles.toolbarSaveBathymetry = <span class="keyword">...</span>
2390     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2391     <span class="string">'CData'</span>,        icons(5).data, <span class="keyword">...</span>
2392     <span class="string">'TooltipString'</span>,<span class="string">'Export Bathymetry'</span>);
2393 
2394 <span class="comment">% Save figures</span>
2395 <span class="comment">% icon = ones(16,16,3);</span>
2396 handles.toolbarSaveFigures = <span class="keyword">...</span>
2397     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2398     <span class="string">'CData'</span>,        icons(6).data, <span class="keyword">...</span>
2399     <span class="string">'TooltipString'</span>,<span class="string">'Export Figures'</span>);
2400 
2401 
2402 <span class="comment">% Plotting parameters</span>
2403 <span class="comment">% [icon,map] = imread('C:\Users\pfricker\Desktop\icons\PlotGeneralElement.gif');</span>
2404 <span class="comment">% icon = ind2rgb(icon,map);</span>
2405 handles.toolbarPlottingParameters = <span class="keyword">...</span>
2406     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2407     <span class="string">'CData'</span>,        icons(3).data, <span class="keyword">...</span>
2408     <span class="string">'TooltipString'</span>,<span class="string">'Plotting Parameters'</span>, <span class="keyword">...</span>
2409     <span class="string">'Separator'</span>,    <span class="string">'on'</span>);
2410 
2411 <span class="comment">% Processing parameters</span>
2412 <span class="comment">% [icon,map] = imread('C:\Users\pfricker\Desktop\icons\ParameterIcon.gif');</span>
2413 <span class="comment">% icon = ind2rgb(icon,map);</span>
2414 handles.toolbarProcessingParameters = <span class="keyword">...</span>
2415     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2416     <span class="string">'CData'</span>,        icons(4).data, <span class="keyword">...</span>
2417     <span class="string">'TooltipString'</span>,<span class="string">'Processing Parameters'</span>);
2418 
2419 <span class="comment">% % Plot 1: Shiptracks</span>
2420 <span class="comment">% handles.shiptracksPlot = ...</span>
2421 <span class="comment">%     uipushtool('Parent',       ht, ...</span>
2422 <span class="comment">%                'CData',        icon, ...</span>
2423 <span class="comment">%                'TooltipString','Shiptracks plot', ...</span>
2424 <span class="comment">%                'Separator',    'on');</span>
2425 <span class="comment">%</span>
2426 <span class="comment">% % Plot 2: Plan view</span>
2427 <span class="comment">% handles.planviewPlot = ...</span>
2428 <span class="comment">%     uipushtool('Parent',       ht, ...</span>
2429 <span class="comment">%                'CData',        icon, ...</span>
2430 <span class="comment">%                'TooltipString','Plan view plot');</span>
2431 <span class="comment">%</span>
2432 <span class="comment">% % Plot 3: Cross section</span>
2433 <span class="comment">% handles.crosssectionPlot = ...</span>
2434 <span class="comment">%     uipushtool('Parent',       ht, ...</span>
2435 <span class="comment">%                'CData',        icon, ...</span>
2436 <span class="comment">%                'TooltipString','Cross section plot');</span>
2437 
2438 set(handles.toolbarLoadData,            <span class="string">'ClickedCallback'</span>,{@<a href="#_sub43" class="code" title="subfunction loadDataCallback(hObject, eventdata, handles)">loadDataCallback</a>,handles})
2439 set(handles.toolbarSaveMatFile,         <span class="string">'ClickedCallback'</span>,{@<a href="#_sub44" class="code" title="subfunction saveDataCallback(hObject, eventdata, handles)">saveDataCallback</a>,handles})
2440 set(handles.toolbarSaveBathymetry,      <span class="string">'ClickedCallback'</span>,{@<a href="#_sub54" class="code" title="subfunction ExportMultibeamBathymetry_Callback(hObject, eventdata, handles)">ExportMultibeamBathymetry_Callback</a>,handles})
2441 set(handles.toolbarSaveFigures,         <span class="string">'ClickedCallback'</span>,{@<a href="#_sub17" class="code" title="subfunction menuExportFigures_Callback(hObject, eventdata, handles)">menuExportFigures_Callback</a>,handles})
2442 set(handles.toolbarPlottingParameters,  <span class="string">'ClickedCallback'</span>,{@<a href="#_sub46" class="code" title="subfunction plottingParametersCallback(hObject, eventdata, handles)">plottingParametersCallback</a>,handles})
2443 set(handles.toolbarProcessingParameters,<span class="string">'ClickedCallback'</span>,{@<a href="#_sub47" class="code" title="subfunction processingParametersCallback(hObject, eventdata, handles)">processingParametersCallback</a>,handles})
2444 <span class="comment">% set(handles.shiptracksPlot,      'ClickedCallback',{@shiptracksPlotCallback,handles})</span>
2445 <span class="comment">% set(handles.planviewPlot,        'ClickedCallback',{@planviewPlotCallback,handles})</span>
2446 <span class="comment">% set(handles.crosssectionPlot,    'ClickedCallback',{@crosssectionPlotCallback,handles})</span>
2447 
2448 <span class="comment">% [EOF] buildtoolbar</span>
2449 
2450 
2451 <span class="comment">% --------------------------------------------------------------------</span>
2452 <a name="_sub85" href="#_subfunctions" class="code">function load_prefs(hfigure)</a>
2453 <span class="comment">% Load the GUI preferences.  Also, initialize preferences if they don't</span>
2454 <span class="comment">% already exist.</span>
2455 
2456 <span class="comment">% Preferences:</span>
2457 <span class="comment">% 'ascii'                Path and filenames of current ASCII files</span>
2458 <span class="comment">% 'mat'                  Path and filename of current MAT file</span>
2459 <span class="comment">% 'tecplot'              Path and filename of last Tecplot file</span>
2460 <span class="comment">% 'kmz'                  Path and filename of last KMZ file</span>
2461 <span class="comment">% 'multibeambathymetry'  Path and filename of last Multibeam Bathymetry file</span>
2462 <span class="comment">% 'log'                  Path and filename of last Log file</span>
2463 <span class="comment">% 'iric'                 Path and filename of last iRic ANV file</span>
2464 
2465 <span class="comment">% Originals</span>
2466 <span class="comment">% prefs = {'ascii2gispath' 'ascii2kmlpath' 'asciipath'   'doqqpath' ...</span>
2467 <span class="comment">%          'endspath'      'logpath'       'matpath'     'savedpath' ...</span>
2468 <span class="comment">%          'shorepath'     'stapath'       'ysidatapath' 'ysidatapath'};</span>
2469 
2470 <span class="comment">% ASCII</span>
2471 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'ascii'</span>)
2472     ascii = getpref(<span class="string">'VMT'</span>,<span class="string">'ascii'</span>);
2473     <span class="keyword">if</span> exist(ascii.path,<span class="string">'dir'</span>)
2474         guiprefs.ascii_path = ascii.path;
2475     <span class="keyword">else</span>
2476         guiprefs.ascii_path = pwd;
2477     <span class="keyword">end</span>
2478     does_exist = false(1,length(ascii.file));
2479     <span class="keyword">for</span> k = 1:length(ascii.file) <span class="comment">% Check each file one-by-one</span>
2480         does_exist(k) = exist(fullfile(ascii.path,ascii.file{k}),<span class="string">'file'</span>);
2481     <span class="keyword">end</span>
2482     <span class="keyword">if</span> any(does_exist)
2483         guiprefs.ascii_file = ascii.file(does_exist);
2484     <span class="keyword">else</span>
2485         guiprefs.ascii_file = {<span class="string">''</span>};
2486     <span class="keyword">end</span>
2487 <span class="keyword">else</span> <span class="comment">% Initialize ASCII</span>
2488     guiprefs.ascii_path = pwd;
2489     guiprefs.ascii_file = {<span class="string">''</span>};
2490     
2491     ascii.path = pwd;
2492     ascii.file = {<span class="string">''</span>};
2493     setpref(<span class="string">'VMT'</span>,<span class="string">'ascii'</span>,ascii)
2494 <span class="keyword">end</span>
2495 
2496 <span class="comment">% MAT</span>
2497 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'mat'</span>)
2498     mat = getpref(<span class="string">'VMT'</span>,<span class="string">'mat'</span>);
2499     <span class="keyword">if</span> exist(mat.path,<span class="string">'dir'</span>)
2500         guiprefs.mat_path = mat.path;
2501     <span class="keyword">else</span>
2502         guiprefs.mat_path = pwd;
2503     <span class="keyword">end</span>
2504     
2505     <span class="keyword">if</span> iscell(mat.file)
2506         <span class="keyword">if</span> exist(fullfile(mat.path,mat.file{1}),<span class="string">'file'</span>)
2507             guiprefs.mat_file = mat.file;
2508         <span class="keyword">else</span>
2509             guiprefs.mat_file = <span class="string">''</span>;
2510         <span class="keyword">end</span>
2511     <span class="keyword">else</span>
2512         <span class="keyword">if</span> exist(fullfile(mat.path,mat.file),<span class="string">'file'</span>)
2513             guiprefs.mat_file = mat.file;
2514         <span class="keyword">else</span>
2515             guiprefs.mat_file = <span class="string">''</span>;
2516         <span class="keyword">end</span>
2517     <span class="keyword">end</span>
2518 <span class="keyword">else</span> <span class="comment">% Initialize MAT</span>
2519     guiprefs.mat_path = pwd;
2520     guiprefs.mat_file = <span class="string">''</span>;
2521     
2522     mat.path = pwd;
2523     mat.file = <span class="string">''</span>;
2524     setpref(<span class="string">'VMT'</span>,<span class="string">'mat'</span>,mat)
2525 <span class="keyword">end</span>
2526 
2527 <span class="comment">% TECPLOT</span>
2528 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'tecplot'</span>)
2529     tecplot = getpref(<span class="string">'VMT'</span>,<span class="string">'tecplot'</span>);
2530     <span class="keyword">if</span> exist(tecplot.path,<span class="string">'dir'</span>)
2531         guiprefs.tecplot_path = tecplot.path;
2532     <span class="keyword">else</span>
2533         guiprefs.tecplot_path = pwd;
2534     <span class="keyword">end</span>
2535     <span class="keyword">if</span> exist(fullfile(tecplot.path,tecplot.file),<span class="string">'file'</span>)
2536         guiprefs.tecplot_file = tecplot.file;
2537     <span class="keyword">else</span>
2538         guiprefs.tecplot_file = <span class="string">''</span>;
2539     <span class="keyword">end</span>
2540 <span class="keyword">else</span> <span class="comment">% Initialize TECPLOT</span>
2541     guiprefs.tecplot_path = pwd;
2542     guiprefs.tecplot_file = <span class="string">''</span>;
2543     
2544     tecplot.path = pwd;
2545     tecplot.file = <span class="string">''</span>;
2546     setpref(<span class="string">'VMT'</span>,<span class="string">'tecplot'</span>,tecplot)
2547 <span class="keyword">end</span>
2548 
2549 <span class="comment">% KMZ</span>
2550 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'kmz'</span>)
2551     kmz = getpref(<span class="string">'VMT'</span>,<span class="string">'kmz'</span>);
2552     <span class="keyword">if</span> exist(kmz.path,<span class="string">'dir'</span>)
2553         guiprefs.kmz_path = kmz.path;
2554     <span class="keyword">else</span>
2555         guiprefs.kmz_path = pwd;
2556     <span class="keyword">end</span>
2557     <span class="keyword">if</span> exist(fullfile(kmz.path,kmz.file),<span class="string">'file'</span>)
2558         guiprefs.kmz_file = kmz.file;
2559     <span class="keyword">else</span>
2560         guiprefs.kmz_file = <span class="string">''</span>;
2561     <span class="keyword">end</span>
2562 <span class="keyword">else</span> <span class="comment">% Initialize KMZ</span>
2563     guiprefs.kmz_path = pwd;
2564     guiprefs.kmz_file = <span class="string">''</span>;
2565     
2566     kmz.path = pwd;
2567     kmz.file = <span class="string">''</span>;
2568     setpref(<span class="string">'VMT'</span>,<span class="string">'kmz'</span>,kmz)
2569 <span class="keyword">end</span>
2570 
2571 <span class="comment">% MULTIBEAM BATHYMETRY</span>
2572 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'multibeambathymetry'</span>)
2573     multibeambathymetry = getpref(<span class="string">'VMT'</span>,<span class="string">'multibeambathymetry'</span>);
2574     <span class="keyword">if</span> exist(multibeambathymetry.path,<span class="string">'dir'</span>)
2575         guiprefs.multibeambathymetry_path = multibeambathymetry.path;
2576     <span class="keyword">else</span>
2577         guiprefs.multibeambathymetry_path = pwd;
2578     <span class="keyword">end</span>
2579     <span class="keyword">if</span> exist(fullfile(multibeambathymetry.path,multibeambathymetry.file),<span class="string">'file'</span>)
2580         guiprefs.multibeambathymetry_file = multibeambathymetry.file;
2581     <span class="keyword">else</span>
2582         guiprefs.multibeambathymetry_file = <span class="string">''</span>;
2583     <span class="keyword">end</span>
2584 <span class="keyword">else</span> <span class="comment">% Initialize MULTIBEAM BATHYMETRY</span>
2585     guiprefs.multibeambathymetry_path = pwd;
2586     guiprefs.multibeambathymetry_file = <span class="string">''</span>;
2587     
2588     multibeambathymetry.path = pwd;
2589     multibeambathymetry.file = <span class="string">''</span>;
2590     setpref(<span class="string">'VMT'</span>,<span class="string">'multibeambathymetry'</span>,multibeambathymetry)
2591 <span class="keyword">end</span>
2592 
2593 <span class="comment">% Log</span>
2594 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'log'</span>)
2595     log = getpref(<span class="string">'VMT'</span>,<span class="string">'log'</span>);
2596     <span class="keyword">if</span> exist(log.path,<span class="string">'dir'</span>)
2597         guiprefs.log_path = log.path;
2598     <span class="keyword">else</span>
2599         guiprefs.log_path = pwd;
2600     <span class="keyword">end</span>
2601     <span class="keyword">if</span> exist(fullfile(log.path,log.file),<span class="string">'file'</span>)
2602         guiprefs.log_file = log.file;
2603     <span class="keyword">else</span>
2604         guiprefs.log_file = <span class="string">''</span>;
2605     <span class="keyword">end</span>
2606 <span class="keyword">else</span> <span class="comment">% Initialize Log</span>
2607     guiprefs.log_path = pwd;
2608     guiprefs.log_file = <span class="string">''</span>;
2609     
2610     log.path = pwd;
2611     log.file = <span class="string">''</span>;
2612     setpref(<span class="string">'VMT'</span>,<span class="string">'log'</span>,log)
2613 <span class="keyword">end</span>
2614 
2615 <span class="comment">% iRic</span>
2616 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'iric'</span>)
2617     iric = getpref(<span class="string">'VMT'</span>,<span class="string">'iric'</span>);
2618     <span class="keyword">if</span> exist(iric.path,<span class="string">'dir'</span>)
2619         guiprefs.iric_path = iric.path;
2620     <span class="keyword">else</span>
2621         guiprefs.iric_path = pwd;
2622     <span class="keyword">end</span>
2623     <span class="keyword">if</span> exist(fullfile(iric.path,iric.file),<span class="string">'file'</span>)
2624         guiprefs.iric_file = iric.file;
2625     <span class="keyword">else</span>
2626         guiprefs.iric_file = <span class="string">''</span>;
2627     <span class="keyword">end</span>
2628 <span class="keyword">else</span> <span class="comment">% Initialize Log</span>
2629     guiprefs.iric_path = pwd;
2630     guiprefs.iric_file = <span class="string">''</span>;
2631     
2632     iric.path = pwd;
2633     iric.file = <span class="string">''</span>;
2634     setpref(<span class="string">'VMT'</span>,<span class="string">'iric'</span>,iric)
2635 <span class="keyword">end</span>
2636 
2637 <span class="comment">% guiprefs.presentation = true;</span>
2638 <span class="comment">% guiprefs.print        = false;</span>
2639 
2640 <span class="comment">% for k = 1:length(prefs)</span>
2641 <span class="comment">%     newpref = '';</span>
2642 <span class="comment">%     if ispref('VMT',prefs{k})</span>
2643 <span class="comment">%         stored_newpref = getpref('VMT',prefs{k});</span>
2644 <span class="comment">%         if exist(stored_newpref,'dir')</span>
2645 <span class="comment">%             newpref = stored_newpref;</span>
2646 <span class="comment">%         else</span>
2647 <span class="comment">%             setpref('VMT',prefs{k},newpref)</span>
2648 <span class="comment">%         end</span>
2649 <span class="comment">%     end</span>
2650 <span class="comment">%     guiprefs.(prefs{k}) = newpref;</span>
2651 <span class="comment">% end</span>
2652 
2653 setappdata(hfigure,<span class="string">'guiprefs'</span>,guiprefs)
2654 
2655 <span class="comment">% [EOF] load_prefs</span>
2656 
2657 
2658 <span class="comment">% --------------------------------------------------------------------</span>
2659 <a name="_sub86" href="#_subfunctions" class="code">function store_prefs(hfigure,pref)</a>
2660 <span class="comment">% Store preferences in the Application data and in the persistent</span>
2661 <span class="comment">% preferences data.</span>
2662 
2663 <span class="comment">% Preferences:</span>
2664 <span class="comment">% 'ascii'               Path and filenames of current ASCII files</span>
2665 <span class="comment">% 'mat'                 Path and filename of current MAT file</span>
2666 <span class="comment">% 'tecplot'             Path and filename of last Tecplot file</span>
2667 <span class="comment">% 'kmz'                 Path and filename of last KMZ file</span>
2668 <span class="comment">% 'multibeambathymetry' Path and filename of last Multibeam Bathymetry file</span>
2669 <span class="comment">% 'log'                 Path and filename of last Log file</span>
2670 
2671 guiprefs = getappdata(hfigure,<span class="string">'guiprefs'</span>);
2672 
2673 <span class="keyword">switch</span> pref
2674     <span class="keyword">case</span> <span class="string">'ascii'</span>
2675         ascii.path = guiprefs.ascii_path;
2676         ascii.file = guiprefs.ascii_file;
2677         setpref(<span class="string">'VMT'</span>,<span class="string">'ascii'</span>,ascii)
2678     <span class="keyword">case</span> <span class="string">'mat'</span>
2679         mat.path = guiprefs.mat_path;
2680         mat.file = guiprefs.mat_file;
2681         setpref(<span class="string">'VMT'</span>,<span class="string">'mat'</span>,mat)
2682     <span class="keyword">case</span> <span class="string">'tecplot'</span>
2683         tecplot.path = guiprefs.tecplot_path;
2684         tecplot.file = guiprefs.tecplot_file;
2685         setpref(<span class="string">'VMT'</span>,<span class="string">'tecplot'</span>,tecplot)
2686     <span class="keyword">case</span> <span class="string">'kmz'</span>
2687         kmz.path = guiprefs.kmz_path;
2688         kmz.file = guiprefs.kmz_file;
2689         setpref(<span class="string">'VMT'</span>,<span class="string">'kmz'</span>,kmz)
2690     <span class="keyword">case</span> <span class="string">'multibeambathymetry'</span>
2691         multibeambathymetry.path = guiprefs.multibeambathymetry_path;
2692         multibeambathymetry.file = guiprefs.multibeambathymetry_file;
2693         setpref(<span class="string">'VMT'</span>,<span class="string">'multibeambathymetry'</span>,multibeambathymetry)
2694     <span class="keyword">case</span> <span class="string">'log'</span>
2695         log.path = guiprefs.log_path;
2696         log.file = guiprefs.log_file;
2697         setpref(<span class="string">'VMT'</span>,<span class="string">'log'</span>,log)
2698     <span class="keyword">otherwise</span>
2699 <span class="keyword">end</span>
2700 
2701 <span class="comment">% if ismember(pref,prefs)</span>
2702 <span class="comment">%     setpref('VMT',pref,value)</span>
2703 <span class="comment">%</span>
2704 <span class="comment">%     guiprefs = getappdata(hfigure,'guiprefs');</span>
2705 <span class="comment">%     guiprefs.(pref) = value;</span>
2706 <span class="comment">%     setappdata(hfigure,'guiprefs',guiprefs)</span>
2707 <span class="comment">% end</span>
2708 
2709 <span class="comment">% [EOF] store_prefs</span>
2710 
2711 
2712 <span class="comment">% --------------------------------------------------------------------</span>
2713 <a name="_sub87" href="#_subfunctions" class="code">function initGUI(handles)</a>
2714 <span class="comment">% Initialize the UI controls in the GUI.</span>
2715 
2716 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2717 
2718 <span class="comment">% Set the name and version</span>
2719 set(handles.figure1,<span class="string">'Name'</span>,[<span class="string">'Velocity Mapping Toolbox (VMT) '</span> guiparams.vmt_version], <span class="keyword">...</span>
2720     <span class="string">'DockControls'</span>,<span class="string">'off'</span>)
2721 <span class="comment">%set(handles.VMTversion,             'String',guiparams.vmt_version)</span>
2722 
2723 <span class="comment">% Set the PLOT 1 axis labels</span>
2724 axes(handles.Plot1Shiptracks);
2725 set(handles.Plot1Shiptracks,<span class="string">'DataAspectRatio'</span>,[1 1 1],<span class="string">'PlotBoxAspectRatio'</span>,[1 1 1])
2726 xlabel(<span class="string">'UTM Easting (m)'</span>)
2727 ylabel(<span class="string">'UTM Northing (m)'</span>)
2728 box on
2729 grid on
2730 <span class="comment">% ticks_format('%6.0f','%8.0f'); %formats the ticks for UTM</span>
2731 
2732 <span class="comment">%%%%%%%%%%%%</span>
2733 <span class="comment">% MENU BAR %</span>
2734 <span class="comment">%%%%%%%%%%%%</span>
2735 <span class="keyword">if</span> guiparams.english_units
2736     set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
2737     set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
2738 <span class="keyword">else</span>
2739     set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
2740     set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
2741 <span class="keyword">end</span>
2742 
2743 <span class="keyword">if</span> guiparams.set_cross_section_endpoints
2744     set(handles.menuCrossSectionEndpointAutomatic,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
2745     set(handles.menuCrossSectionEndpointManual,   <span class="string">'Checked'</span>,<span class="string">'on'</span>)
2746 <span class="keyword">else</span>
2747     set(handles.menuCrossSectionEndpointAutomatic,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
2748     set(handles.menuCrossSectionEndpointManual,   <span class="string">'Checked'</span>,<span class="string">'off'</span>)
2749 <span class="keyword">end</span>
2750 
2751 
2752 <span class="keyword">if</span> guiparams.print
2753     set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'on'</span>)
2754     set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
2755     set(handles.menuStylePrint,        <span class="string">'Checked'</span>,<span class="string">'on'</span>)
2756     set(handles.menuStylePresentation, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
2757 <span class="keyword">elseif</span> guiparams.presentation
2758     set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'off'</span>)
2759     set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
2760     set(handles.menuStylePrint,        <span class="string">'Checked'</span>,<span class="string">'off'</span>)
2761     set(handles.menuStylePresentation, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
2762 <span class="keyword">else</span>
2763 <span class="keyword">end</span>
2764 
2765 
2766 <span class="comment">%%%%%%%%%%%%%%%</span>
2767 <span class="comment">% DATA EXPORT %</span>
2768 <span class="comment">%%%%%%%%%%%%%%%</span>
2769 <span class="comment">% BathymetryPanel</span>
2770 <span class="comment">% set(handles.BeamAngle,                  'String',guiparams.beam_angle)</span>
2771 <span class="comment">% set(handles.MagneticVariation,          'String',guiparams.magnetic_variation)</span>
2772 <span class="comment">% set(handles.WSE,                        'String',guiparams.wse)</span>
2773 <span class="comment">% set(handles.OutputAuxiliaryData,        'Value', guiparams.output_auxiliary_data)</span>
2774 
2775 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
2776 <span class="comment">% PLOTTING/PLAN VIEW %</span>
2777 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
2778 <span class="comment">% PlanViewPanel</span>
2779 set(handles.DepthRangeMin,              <span class="string">'String'</span>,guiparams.depth_range_min)
2780 set(handles.DepthRangeMax,              <span class="string">'String'</span>,guiparams.depth_range_max)
2781 set(handles.VectorScalePlanView,        <span class="string">'String'</span>,guiparams.vector_scale_plan_view)
2782 set(handles.VectorSpacingPlanview,      <span class="string">'String'</span>,guiparams.vector_spacing_plan_view)
2783 set(handles.SmoothingWindowSize,        <span class="string">'String'</span>,guiparams.smoothing_window_size)
2784 set(handles.MapDepthAveragedVelocities, <span class="string">'Value'</span>, guiparams.map_depth_averaged_velocities)
2785 set(handles.DisplayShoreline,           <span class="string">'Value'</span>, guiparams.display_shoreline)
2786 set(handles.AddBackground,              <span class="string">'Value'</span>, guiparams.add_background)
2787 
2788 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%</span>
2789 <span class="comment">% PLOTTING/SHIP TRACKS %</span>
2790 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%</span>
2791 <span class="comment">% ShiptracksPanel</span>
2792 set(handles.HorizontalGridNodeSpacing,  <span class="string">'String'</span>,guiparams.horizontal_grid_node_spacing)
2793 <span class="comment">%set(handles.SetCrossSectionEndpoints,   'Value', guiparams.set_cross_section_endpoints)</span>
2794 
2795 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
2796 <span class="comment">% PLOTTING/CROSS SECTIONS %</span>
2797 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
2798 <span class="comment">% CrossSectionsPanel</span>
2799 set(handles.Contour,                    <span class="string">'String'</span>,{guiparams.contours.string}, <span class="keyword">...</span>
2800     <span class="string">'Value'</span>, guiparams.idx_contour)
2801 set(handles.VerticalExaggeration,       <span class="string">'String'</span>,guiparams.vertical_exaggeration)
2802 set(handles.VectorScaleCrossSection,    <span class="string">'String'</span>,guiparams.vector_scale_cross_section)
2803 set(handles.HorizontalVectorSpacing,    <span class="string">'String'</span>,guiparams.horizontal_vector_spacing)
2804 set(handles.VerticalVectorSpacing,      <span class="string">'String'</span>,guiparams.vertical_vector_spacing)
2805 set(handles.HorizontalSmoothingWindow,  <span class="string">'String'</span>,guiparams.horizontal_smoothing_window)
2806 set(handles.VerticalSmoothingWindow,    <span class="string">'String'</span>,guiparams.vertical_smoothing_window)
2807 set(handles.PlotSecondaryFlowVectors,   <span class="string">'Value'</span>, guiparams.plot_secondary_flow_vectors)
2808 set(handles.SecondaryFlowVectorVariable,<span class="string">'String'</span>,{guiparams.secondary_flows.string}, <span class="keyword">...</span>
2809     <span class="string">'Value'</span>, guiparams.idx_secondary_flow_vector_variable)
2810 set(handles.IncludeVerticalVelocity,    <span class="string">'Value'</span>, guiparams.include_vertical_velocity)
2811 
2812 <span class="comment">% set(handles.EnglishUnits,               'Value',guiparams.english_units)</span>
2813 
2814 <span class="comment">% [EOF] initGUI</span>
2815 
2816 
2817 <span class="comment">% --------------------------------------------------------------------</span>
2818 <a name="_sub88" href="#_subfunctions" class="code">function set_enable(handles,enable_state)</a>
2819 
2820 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2821 
2822 <span class="keyword">switch</span> enable_state
2823     <span class="keyword">case</span> <span class="string">'init'</span>
2824         set([handles.menuFile
2825             handles.menuOpen
2826             handles.menuOpenASCII
2827             handles.menuOpenMAT
2828             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2829 <span class="comment">%         set([handles.menuSave</span>
2830 <span class="comment">%             handles.menuParameters</span>
2831 <span class="comment">%             ],'Enable','off')</span>
2832         
2833         set([handles.toolbarLoadData
2834             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2835         set([handles.toolbarSaveMatFile
2836             handles.toolbarSaveBathymetry
2837             handles.toolbarSaveFigures
2838             handles.toolbarPlottingParameters
2839             handles.toolbarProcessingParameters
2840             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2841         
2842         <span class="comment">%         set([handles.SaveMATFile</span>
2843         <span class="comment">%              handles.SaveTecplotFile</span>
2844         <span class="comment">%              handles.SaveGoogleEarthFile</span>
2845         <span class="comment">%              ],'Enable','off')</span>
2846         
2847         <span class="comment">%         set([handles.ExportMultibeamBathymetry</span>
2848         <span class="comment">%              handles.BeamAngle</span>
2849         <span class="comment">%              handles.MagneticVariation</span>
2850         <span class="comment">%              handles.WSE</span>
2851         <span class="comment">%              handles.OutputAuxiliaryData</span>
2852         <span class="comment">%              ],'Enable','off')</span>
2853         
2854         set([handles.DepthRangeMin
2855             handles.DepthRangeMax
2856             handles.VectorScalePlanView
2857             handles.VectorSpacingPlanview
2858             handles.SmoothingWindowSize
2859             handles.MapDepthAveragedVelocities
2860             handles.DisplayShoreline
2861             handles.AddBackground
2862             handles.PlotPlanView
2863             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2864         
2865         set([handles.HorizontalGridNodeSpacing
2866             <span class="keyword">...</span><span class="comment">handles.SetCrossSectionEndpoints</span>
2867             handles.PlotShiptracks
2868             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2869         
2870         set([handles.Contour
2871             handles.VerticalExaggeration
2872             handles.VectorScaleCrossSection
2873             handles.HorizontalVectorSpacing
2874             handles.VerticalVectorSpacing
2875             handles.HorizontalSmoothingWindow
2876             handles.VerticalSmoothingWindow
2877             handles.PlotSecondaryFlowVectors
2878             handles.SecondaryFlowVectorVariable
2879             handles.IncludeVerticalVelocity
2880             handles.PlotCrossSection
2881             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2882         
2883     <span class="keyword">case</span> <span class="string">'fileloaded'</span>
2884         set([handles.menuFile
2885             handles.menuOpen
2886             handles.menuOpenASCII
2887             handles.menuOpenMAT
2888             <span class="keyword">...</span><span class="comment">handles.menuSave</span>
2889             handles.menuSaveMAT
2890             handles.menuSaveTecplot
2891             handles.menuSaveKMZFile
2892             handles.menuParameters
2893             handles.menuPlottingParameters
2894             handles.menuMetric
2895             handles.menuEnglish
2896             handles.menuBathymetryExportSettings
2897             handles.menuExportMultibeamBathymetry
2898             handles.menuKMZExport
2899             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2900         
2901         set([handles.toolbarLoadData
2902             handles.toolbarSaveMatFile
2903             handles.toolbarSaveBathymetry
2904             handles.toolbarSaveFigures
2905             handles.toolbarPlottingParameters
2906             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2907         set([handles.toolbarProcessingParameters
2908             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2909         
2910            
2911         set([handles.DepthRangeMin
2912             handles.DepthRangeMax
2913             handles.VectorScalePlanView
2914             handles.VectorSpacingPlanview
2915             handles.SmoothingWindowSize
2916             handles.MapDepthAveragedVelocities
2917             handles.DisplayShoreline
2918             handles.PlotPlanView
2919             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2920         <span class="keyword">if</span> guiparams.has_mapping_toolbox
2921             set(handles.AddBackground,<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2922         <span class="keyword">else</span>
2923             set(handles.AddBackground,<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2924         <span class="keyword">end</span>
2925         
2926         set([handles.HorizontalGridNodeSpacing
2927             <span class="keyword">...</span><span class="comment">handles.SetCrossSectionEndpoints</span>
2928             handles.PlotShiptracks
2929             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2930         
2931         set([handles.Contour
2932             handles.VerticalExaggeration
2933             handles.VectorScaleCrossSection
2934             handles.HorizontalVectorSpacing
2935             handles.VerticalVectorSpacing
2936             handles.HorizontalSmoothingWindow
2937             handles.VerticalSmoothingWindow
2938             handles.PlotSecondaryFlowVectors
2939             handles.SecondaryFlowVectorVariable
2940             handles.IncludeVerticalVelocity
2941             handles.PlotCrossSection
2942             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2943     <span class="keyword">case</span> <span class="string">'multiplematfiles'</span>
2944         set([handles.menuFile
2945             handles.menuOpen
2946             handles.menuOpenASCII
2947             handles.menuOpenMAT
2948             handles.menuParameters
2949             handles.menuPlottingParameters
2950             handles.menuMetric
2951             handles.menuEnglish
2952             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2953         set([handles.menuSave
2954             handles.menuSaveMAT
2955             handles.menuBathymetryExportSettings
2956             handles.menuExportMultibeamBathymetry
2957             handles.menuKMZExport
2958             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2959         
2960         set([handles.toolbarLoadData
2961             handles.toolbarSaveFigures
2962             handles.toolbarPlottingParameters
2963             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2964         set([handles.toolbarProcessingParameters
2965             handles.toolbarSaveMatFile
2966             handles.toolbarSaveBathymetry
2967             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2968         
2969         set([handles.DepthRangeMin
2970             handles.DepthRangeMax
2971             handles.VectorScalePlanView
2972             handles.VectorSpacingPlanview
2973             handles.SmoothingWindowSize
2974             handles.MapDepthAveragedVelocities
2975             handles.DisplayShoreline
2976             handles.PlotPlanView
2977             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2978         <span class="keyword">if</span> guiparams.has_mapping_toolbox
2979             set(handles.AddBackground,<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2980         <span class="keyword">else</span>
2981             set(handles.AddBackground,<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2982         <span class="keyword">end</span>
2983         
2984         set([handles.HorizontalGridNodeSpacing
2985             <span class="keyword">...</span><span class="comment">handles.SetCrossSectionEndpoints</span>
2986             handles.PlotShiptracks
2987             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2988         
2989         set([handles.Contour
2990             handles.VerticalExaggeration
2991             handles.VectorScaleCrossSection
2992             handles.HorizontalVectorSpacing
2993             handles.VerticalVectorSpacing
2994             handles.HorizontalSmoothingWindow
2995             handles.VerticalSmoothingWindow
2996             handles.PlotSecondaryFlowVectors
2997             handles.SecondaryFlowVectorVariable
2998             handles.IncludeVerticalVelocity
2999             handles.PlotCrossSection
3000             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
3001     <span class="keyword">otherwise</span>
3002 <span class="keyword">end</span>
3003 
3004 <span class="comment">% Temporary</span>
3005 set(handles.MapDepthAveragedVelocities,<span class="string">'Value'</span>,0,<span class="string">'Enable'</span>,<span class="string">'off'</span>)
3006 
3007 <span class="comment">% [EOF] set_enable</span>
3008 
3009 <span class="comment">%% Compute the longitudinal dispersion coefficient</span>
3010 
3011 <span class="comment">%% --- Executes on button press in zerosecq_chkbox.</span>
3012 <span class="comment">%function zerosecq_chkbox_Callback(hObject, eventdata, handles)</span>
3013 <span class="comment">% hObject    handle to zerosecq_chkbox (see GCBO)</span>
3014 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
3015 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
3016 
3017 <span class="comment">% Hint: get(hObject,'Value') returns toggle state of zerosecq_chkbox</span>
3018 
3019 
3020 <span class="comment">% --------------------------------------------------------------------</span>
3021 <a name="_sub89" href="#_subfunctions" class="code">function [english_units,set_cross_section_endpoints,plot_presentation_style,plot_print_style] = </a><span class="keyword">...</span>
3022     plotParametersDialog(english_units,set_cross_section_endpoints,plot_presentation_style,plot_print_style,hf)
3023 
3024 w = 500;
3025 h = 110;
3026 dx = 10;
3027 dy = 35;
3028 the_color = get(0,<span class="string">'factoryUipanelBackgroundColor'</span>);
3029 handles.Figure = figure(<span class="string">'Name'</span>, <span class="string">'Plotting Parameters'</span>, <span class="keyword">...</span>
3030     <span class="string">'Color'</span>,the_color, <span class="keyword">...</span>
3031     <span class="string">'NumberTitle'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
3032     <span class="string">'HandleVisibility'</span>,<span class="string">'callback'</span>, <span class="keyword">...</span>
3033     <span class="string">'WindowStyle'</span>,<span class="string">'modal'</span>, <span class="keyword">...</span>
3034     <span class="string">'MenuBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
3035     <span class="string">'ToolBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
3036     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3037     <span class="string">'Position'</span>,[0 0 w h], <span class="keyword">...</span>
3038     <span class="string">'Resize'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
3039     <span class="string">'Visible'</span>,<span class="string">'off'</span>);
3040 dialog_params.english_units               = english_units;
3041 dialog_params.set_cross_section_endpoints = set_cross_section_endpoints;
3042 dialog_params.presentation                = plot_presentation_style; <span class="comment">%presentation;</span>
3043 dialog_params.print                       = plot_print_style; <span class="comment">%print;</span>
3044 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3045 setappdata(handles.Figure,<span class="string">'original_dialog_params'</span>,dialog_params)
3046 
3047 <span class="comment">% Build the graphics:</span>
3048 <span class="comment">% -------------------</span>
3049 handles.UnitsPanel = uipanel(<span class="string">'Parent'</span>,handles.Figure, <span class="keyword">...</span>
3050     <span class="string">'Title'</span>, <span class="string">'Units'</span>, <span class="keyword">...</span>
3051     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3052     <span class="string">'Position'</span>,[dx dy (w-3*dx)/3 h-dx-dy+10]);
3053 handles.UnitsMetric = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
3054     <span class="string">'Parent'</span>,handles.UnitsPanel, <span class="keyword">...</span>
3055     <span class="string">'String'</span>,<span class="string">'Metric'</span>, <span class="keyword">...</span>
3056     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3057     <span class="string">'Position'</span>,[15 35 100 22]);
3058 handles.UnitsEnglish = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
3059     <span class="string">'Parent'</span>,handles.UnitsPanel, <span class="keyword">...</span>
3060     <span class="string">'String'</span>,<span class="string">'English'</span>, <span class="keyword">...</span>
3061     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3062     <span class="string">'Position'</span>,[15 10 100 22]);
3063 
3064 handles.EndpointsPanel = uipanel(<span class="string">'Parent'</span>,handles.Figure, <span class="keyword">...</span>
3065     <span class="string">'Title'</span>, <span class="string">'Cross-Section Endpoints'</span>, <span class="keyword">...</span>
3066     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3067     <span class="string">'Position'</span>,[(w+dx)/3 dy (w-3*dx)/3 h-dx-dy+10]);
3068 handles.EndpointsAutomatic = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
3069     <span class="string">'Parent'</span>,handles.EndpointsPanel, <span class="keyword">...</span>
3070     <span class="string">'String'</span>,<span class="string">'Automatic'</span>, <span class="keyword">...</span>
3071     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3072     <span class="string">'Position'</span>,[15 35 100 22]);
3073 handles.EndpointsManual = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
3074     <span class="string">'Parent'</span>,handles.EndpointsPanel, <span class="keyword">...</span>
3075     <span class="string">'String'</span>,<span class="string">'Set Manually'</span>, <span class="keyword">...</span>
3076     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3077     <span class="string">'Position'</span>,[15 10 100 22]);
3078 
3079 handles.StylePanel = uipanel(<span class="string">'Parent'</span>,handles.Figure, <span class="keyword">...</span>
3080     <span class="string">'Title'</span>, <span class="string">'Plot Style'</span>, <span class="keyword">...</span>
3081     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3082     <span class="string">'Position'</span>,[w-w/3 dy (w-3*dx)/3 h-dx-dy+10]);
3083 handles.StylePresentation = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
3084     <span class="string">'Parent'</span>,handles.StylePanel, <span class="keyword">...</span>
3085     <span class="string">'String'</span>,<span class="string">'Presentation'</span>, <span class="keyword">...</span>
3086     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3087     <span class="string">'Position'</span>,[15 35 100 22]);
3088 handles.StylePrint = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
3089     <span class="string">'Parent'</span>,handles.StylePanel, <span class="keyword">...</span>
3090     <span class="string">'String'</span>,<span class="string">'Print'</span>, <span class="keyword">...</span>
3091     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3092     <span class="string">'Position'</span>,[15 10 100 22]);
3093 
3094 handles.OK = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3095     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3096     <span class="string">'String'</span>,  <span class="string">'OK'</span>, <span class="keyword">...</span>
3097     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3098     <span class="string">'Position'</span>,[w/2-80-dx/4 6 80 22]);
3099 handles.Cancel = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3100     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3101     <span class="string">'String'</span>,  <span class="string">'Cancel'</span>, <span class="keyword">...</span>
3102     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3103     <span class="string">'Position'</span>,[w/2+dx/4 6 80 22]);
3104 
3105 <span class="comment">% Update the UI controls:</span>
3106 <span class="comment">% -----------------------</span>
3107 <span class="keyword">if</span> dialog_params.english_units
3108     set(handles.UnitsMetric, <span class="string">'Value'</span>,0)
3109     set(handles.UnitsEnglish,<span class="string">'Value'</span>,1)
3110 <span class="keyword">else</span>
3111     set(handles.UnitsMetric, <span class="string">'Value'</span>,1)
3112     set(handles.UnitsEnglish,<span class="string">'Value'</span>,0)
3113 <span class="keyword">end</span>
3114 <span class="keyword">if</span> dialog_params.set_cross_section_endpoints
3115     set(handles.EndpointsAutomatic,<span class="string">'Value'</span>,0)
3116     set(handles.EndpointsManual,   <span class="string">'Value'</span>,1)
3117 <span class="keyword">else</span>
3118     set(handles.EndpointsAutomatic,<span class="string">'Value'</span>,1)
3119     set(handles.EndpointsManual,   <span class="string">'Value'</span>,0)
3120 <span class="keyword">end</span>
3121 <span class="keyword">if</span> dialog_params.presentation
3122     set(handles.StylePresentation, <span class="string">'Value'</span>,1)
3123     set(handles.StylePrint,        <span class="string">'Value'</span>,0)
3124 <span class="keyword">else</span>
3125     set(handles.StylePresentation, <span class="string">'Value'</span>,0)
3126     set(handles.StylePrint,        <span class="string">'Value'</span>,1)
3127 <span class="keyword">end</span>
3128 
3129 <span class="comment">% Set the callbacks:</span>
3130 <span class="comment">% ------------------</span>
3131 set(handles.Figure,            <span class="string">'CloseRequestFcn'</span>,{@<a href="#_sub95" class="code" title="subfunction dialogCloseReq(hObject,eventdata,h_OK)">dialogCloseReq</a>,handles.OK})
3132 set(handles.UnitsMetric,       <span class="string">'Callback'</span>,       {@<a href="#_sub90" class="code" title="subfunction dialogUnits(hObject,eventdata,handles,the_units)">dialogUnits</a>,    handles,<span class="string">'metric'</span>})
3133 set(handles.UnitsEnglish,      <span class="string">'Callback'</span>,       {@<a href="#_sub90" class="code" title="subfunction dialogUnits(hObject,eventdata,handles,the_units)">dialogUnits</a>,    handles,<span class="string">'english'</span>})
3134 set(handles.EndpointsAutomatic,<span class="string">'Callback'</span>,       {@<a href="#_sub91" class="code" title="subfunction dialogEnpoints(hObject,eventdata,handles,the_endpoints)">dialogEnpoints</a>, handles,<span class="string">'auto'</span>})
3135 set(handles.EndpointsManual,   <span class="string">'Callback'</span>,       {@<a href="#_sub91" class="code" title="subfunction dialogEnpoints(hObject,eventdata,handles,the_endpoints)">dialogEnpoints</a>, handles,<span class="string">'manual'</span>})
3136 set(handles.StylePresentation, <span class="string">'Callback'</span>,       {@<a href="#_sub92" class="code" title="subfunction dialogPlotStyle(hObject,eventdata,handles,the_style)">dialogPlotStyle</a>,handles,<span class="string">'presentation'</span>})
3137 set(handles.StylePrint,        <span class="string">'Callback'</span>,       {@<a href="#_sub92" class="code" title="subfunction dialogPlotStyle(hObject,eventdata,handles,the_style)">dialogPlotStyle</a>,handles,<span class="string">'print'</span>})
3138 set(handles.OK,                <span class="string">'Callback'</span>,       {@<a href="#_sub93" class="code" title="subfunction dialogOK(hObject,eventdata,h_OK)">dialogOK</a>,       handles.OK})
3139 set(handles.Cancel,            <span class="string">'Callback'</span>,       {@<a href="#_sub94" class="code" title="subfunction dialogCancel(hObject,eventdata,handles)">dialogCancel</a>,   handles})
3140 
3141 <span class="comment">% Position the dialog and make it visible:</span>
3142 <span class="comment">% ----------------------------------------</span>
3143 fpos = get(hf,<span class="string">'Position'</span>);
3144 dpos = [(fpos(1) + fpos(3)/2 -w/2) (fpos(2) + fpos(4)/2)];
3145 movegui(handles.Figure,dpos)
3146 set(handles.Figure,<span class="string">'Visible'</span>,<span class="string">'on'</span>)
3147 
3148 <span class="comment">% Hold the dialog open:</span>
3149 <span class="comment">% ---------------------</span>
3150 waitfor(handles.OK)
3151 
3152 <span class="comment">% Return the outputs and close the dialog:</span>
3153 <span class="comment">% ----------------------------------------</span>
3154 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3155 english_units = dialog_params.english_units;
3156 set_cross_section_endpoints = dialog_params.set_cross_section_endpoints;
3157 plot_presentation_style =  dialog_params.presentation;
3158 plot_print_style =  dialog_params.print;
3159 
3160 delete(handles.Figure)
3161 
3162 <span class="comment">% [EOF] plotParametersDialog</span>
3163 
3164 
3165 <span class="comment">% --------------------------------------------------------------------</span>
3166 <a name="_sub90" href="#_subfunctions" class="code">function dialogUnits(hObject,eventdata,handles,the_units)</a>
3167 
3168 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3169 <span class="keyword">switch</span> the_units
3170     <span class="keyword">case</span> <span class="string">'metric'</span>
3171         dialog_params.english_units = false;
3172         
3173         set(handles.UnitsMetric, <span class="string">'Value'</span>,1)
3174         set(handles.UnitsEnglish,<span class="string">'Value'</span>,0)
3175     <span class="keyword">case</span> <span class="string">'english'</span>
3176         dialog_params.english_units = true;
3177         
3178         set(handles.UnitsMetric, <span class="string">'Value'</span>,0)
3179         set(handles.UnitsEnglish,<span class="string">'Value'</span>,1)
3180     <span class="keyword">otherwise</span>
3181 <span class="keyword">end</span>
3182 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3183 
3184 <span class="comment">% [EOF] dialogUnits</span>
3185 
3186 <span class="comment">% --------------------------------------------------------------------</span>
3187 <a name="_sub91" href="#_subfunctions" class="code">function dialogEnpoints(hObject,eventdata,handles,the_endpoints)</a>
3188 
3189 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3190 <span class="keyword">switch</span> the_endpoints
3191     <span class="keyword">case</span> <span class="string">'auto'</span>
3192         dialog_params.set_cross_section_endpoints = false;
3193         
3194         set(handles.EndpointsAutomatic,<span class="string">'Value'</span>,1)
3195         set(handles.EndpointsManual,   <span class="string">'Value'</span>,0)
3196     <span class="keyword">case</span> <span class="string">'manual'</span>
3197         dialog_params.set_cross_section_endpoints = true;
3198         
3199         set(handles.EndpointsAutomatic,<span class="string">'Value'</span>,0)
3200         set(handles.EndpointsManual,   <span class="string">'Value'</span>,1)
3201     <span class="keyword">otherwise</span>
3202 <span class="keyword">end</span>
3203 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3204 
3205 <span class="comment">% [EOF] dialogEnpoints</span>
3206 
3207 <a name="_sub92" href="#_subfunctions" class="code">function dialogPlotStyle(hObject,eventdata,handles,the_style)</a>
3208 
3209 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3210 <span class="keyword">switch</span> the_style
3211     <span class="keyword">case</span> <span class="string">'presentation'</span>
3212         dialog_params.presentation  = true;
3213         dialog_params.print         = false;
3214         
3215         set(handles.StylePresentation,<span class="string">'Value'</span>,1)
3216         set(handles.StylePrint,       <span class="string">'Value'</span>,0)
3217     <span class="keyword">case</span> <span class="string">'print'</span>
3218         dialog_params.presentation  = false;
3219         dialog_params.print         = true;
3220         
3221         set(handles.StylePresentation,<span class="string">'Value'</span>,0)
3222         set(handles.StylePrint,       <span class="string">'Value'</span>,1)
3223     <span class="keyword">otherwise</span>
3224 <span class="keyword">end</span>
3225 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3226 
3227 <span class="comment">% [EOF] dialogEnpoints</span>
3228 
3229 <span class="comment">% --------------------------------------------------------------------</span>
3230 <a name="_sub93" href="#_subfunctions" class="code">function dialogOK(hObject,eventdata,h_OK)</a>
3231 
3232 delete(h_OK)
3233 
3234 <span class="comment">% [EOF] dialogOK</span>
3235 
3236 <span class="comment">% --------------------------------------------------------------------</span>
3237 <a name="_sub94" href="#_subfunctions" class="code">function dialogCancel(hObject,eventdata,handles)</a>
3238 <span class="comment">% Return the original inputs</span>
3239 dialog_params = getappdata(handles.Figure,<span class="string">'original_dialog_params'</span>);
3240 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3241 delete(handles.OK)
3242 
3243 <span class="comment">% [EOF] dialogCancel</span>
3244 
3245 <span class="comment">% --------------------------------------------------------------------</span>
3246 <a name="_sub95" href="#_subfunctions" class="code">function dialogCloseReq(hObject,eventdata,h_OK)</a>
3247 
3248 delete(h_OK)
3249 
3250 <span class="comment">% [EOF] dialogCloseReq</span>
3251 
3252 <a name="_sub96" href="#_subfunctions" class="code">function [beam_angle,magnetic_variation,wse,output_auxilliary_data] = exportSettingsDialog(beam_angle,magnetic_variation,wse,output_auxilliary_data,hf)</a>
3253 w = 230;
3254 h = 200;
3255 dx = 10;
3256 dy = 35;
3257 the_color = get(0,<span class="string">'factoryUipanelBackgroundColor'</span>);
3258 handles.Figure = figure(<span class="string">'Name'</span>, <span class="string">'Export Settings'</span>, <span class="keyword">...</span>
3259     <span class="string">'Color'</span>,the_color, <span class="keyword">...</span>
3260     <span class="string">'NumberTitle'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
3261     <span class="string">'HandleVisibility'</span>,<span class="string">'callback'</span>, <span class="keyword">...</span>
3262     <span class="string">'WindowStyle'</span>,<span class="string">'modal'</span>, <span class="keyword">...</span>
3263     <span class="string">'MenuBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
3264     <span class="string">'ToolBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
3265     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3266     <span class="string">'Position'</span>,[0 0 w h], <span class="keyword">...</span>
3267     <span class="string">'Resize'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
3268     <span class="string">'Visible'</span>,<span class="string">'off'</span>);
3269 dialog_params.beam_angle             = beam_angle;
3270 dialog_params.magnetic_variation     = magnetic_variation;
3271 dialog_params.wse                    = wse;
3272 dialog_params.output_auxilliary_data = output_auxilliary_data;
3273 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3274 setappdata(handles.Figure,<span class="string">'original_dialog_params'</span>,dialog_params)
3275 
3276 <span class="comment">% Build the graphics:</span>
3277 <span class="comment">% -------------------</span>
3278 ph = 150;
3279 handles.BathymetryPanel = uipanel(<span class="string">'Parent'</span>,handles.Figure, <span class="keyword">...</span>
3280     <span class="string">'Title'</span>, <span class="string">'Bathymetry'</span>, <span class="keyword">...</span>
3281     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3282     <span class="string">'Position'</span>,[dx dy (w-2*dx) h-dx-dy+10]);
3283 handles.BeamAngleText = uicontrol(<span class="string">'Style'</span>,<span class="string">'text'</span>, <span class="keyword">...</span>
3284     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3285     <span class="string">'String'</span>,<span class="string">'Beam Angle (deg)'</span>, <span class="keyword">...</span>
3286     <span class="keyword">...</span><span class="comment">'Value',beam_angle,...</span>
3287     <span class="string">'HorizontalAlignment'</span>,<span class="string">'right'</span>,<span class="keyword">...</span>
3288     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3289     <span class="string">'Position'</span>,[dx+5 h-ph+60-4 100 22]);
3290 handles.BeamAngle = uicontrol(<span class="string">'Style'</span>,<span class="string">'edit'</span>, <span class="keyword">...</span>
3291     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3292     <span class="keyword">...</span><span class="comment">'String','Beam Angle (deg)', ...</span>
3293     <span class="string">'String'</span>,beam_angle,<span class="keyword">...</span>
3294     <span class="string">'BackgroundColor'</span>,<span class="string">'w'</span>,<span class="keyword">...</span>
3295     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3296     <span class="string">'Position'</span>,[w-dx-80 h-ph+60 50 22]);
3297 handles.MagneticVariationText = uicontrol(<span class="string">'Style'</span>,<span class="string">'text'</span>, <span class="keyword">...</span>
3298     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3299     <span class="string">'String'</span>,<span class="string">'Magnetic Variation'</span>, <span class="keyword">...</span>
3300     <span class="keyword">...</span><span class="comment">'Value',beam_angle,...</span>
3301     <span class="string">'HorizontalAlignment'</span>,<span class="string">'right'</span>,<span class="keyword">...</span>
3302     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3303     <span class="string">'Position'</span>,[dx+5 h-ph+30-4 100 22]);
3304 handles.MagneticVariation = uicontrol(<span class="string">'Style'</span>,<span class="string">'edit'</span>, <span class="keyword">...</span>
3305     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3306     <span class="keyword">...</span><span class="comment">'String','Magnetic Variation', ...</span>
3307     <span class="string">'String'</span>,magnetic_variation,<span class="keyword">...</span>
3308     <span class="string">'BackgroundColor'</span>,<span class="string">'w'</span>,<span class="keyword">...</span>
3309     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3310     <span class="string">'Position'</span>,[w-dx-80 h-ph+30 50 22]);
3311 handles.WSEText = uicontrol(<span class="string">'Style'</span>,<span class="string">'text'</span>, <span class="keyword">...</span>
3312     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3313     <span class="string">'String'</span>,<span class="string">'WSE (m)'</span>, <span class="keyword">...</span>
3314     <span class="keyword">...</span><span class="comment">'Value',beam_angle,...</span>
3315     <span class="string">'HorizontalAlignment'</span>,<span class="string">'right'</span>,<span class="keyword">...</span>
3316     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3317     <span class="string">'Position'</span>,[dx+5 h-ph-4 100 22]);
3318 handles.WSE = uicontrol(<span class="string">'Style'</span>,<span class="string">'edit'</span>, <span class="keyword">...</span>
3319     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3320     <span class="keyword">...</span><span class="comment">'String','Magnetic Variation', ...</span>
3321     <span class="string">'String'</span>,wse,<span class="keyword">...</span>
3322     <span class="string">'BackgroundColor'</span>,<span class="string">'w'</span>,<span class="keyword">...</span>
3323     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3324     <span class="string">'Position'</span>,[w-dx-80 h-ph 50 22]);
3325 handles.OutputAuxilliaryData = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
3326     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3327     <span class="string">'String'</span>,<span class="string">'Output Auxilliary Data'</span>, <span class="keyword">...</span>
3328     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3329     <span class="string">'Position'</span>,[dx+5 20 w-2*dx-30 22]);
3330 handles.OK = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3331     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3332     <span class="string">'String'</span>,  <span class="string">'OK'</span>, <span class="keyword">...</span>
3333     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3334     <span class="string">'Position'</span>,[w/2-80-dx/4 6 80 22]);
3335 handles.Cancel = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3336     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3337     <span class="string">'String'</span>,  <span class="string">'Cancel'</span>, <span class="keyword">...</span>
3338     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3339     <span class="string">'Position'</span>,[w/2+dx/4 6 80 22]);
3340 
3341 <span class="comment">% Update the UI controls:</span>
3342 <span class="comment">% -----------------------</span>
3343 set(handles.BeamAngle,                <span class="string">'String'</span>,dialog_params.beam_angle)
3344 set(handles.MagneticVariation,        <span class="string">'String'</span>,dialog_params.magnetic_variation)
3345 set(handles.WSE,                      <span class="string">'String'</span>,dialog_params.wse)
3346 set(handles.OutputAuxilliaryData,     <span class="string">'Value'</span>,dialog_params.output_auxilliary_data)
3347 
3348 <span class="comment">% Set the callbacks:</span>
3349 <span class="comment">% ------------------</span>
3350 set(handles.Figure,                      <span class="string">'CloseRequestFcn'</span>,{@<a href="#_sub95" class="code" title="subfunction dialogCloseReq(hObject,eventdata,h_OK)">dialogCloseReq</a>,handles.OK})
3351 set(handles.BeamAngle,                   <span class="string">'Callback'</span>,       {@<a href="#_sub97" class="code" title="subfunction dialogExportSettings(hObject,eventdata,handles)">dialogExportSettings</a>,handles})
3352 set(handles.MagneticVariation,           <span class="string">'Callback'</span>,       {@<a href="#_sub97" class="code" title="subfunction dialogExportSettings(hObject,eventdata,handles)">dialogExportSettings</a>,handles})
3353 set(handles.WSE,                         <span class="string">'Callback'</span>,       {@<a href="#_sub97" class="code" title="subfunction dialogExportSettings(hObject,eventdata,handles)">dialogExportSettings</a>,handles})
3354 set(handles.OutputAuxilliaryData,        <span class="string">'Callback'</span>,       {@<a href="#_sub97" class="code" title="subfunction dialogExportSettings(hObject,eventdata,handles)">dialogExportSettings</a>,handles})
3355 set(handles.OK,                          <span class="string">'Callback'</span>,       {@<a href="#_sub93" class="code" title="subfunction dialogOK(hObject,eventdata,h_OK)">dialogOK</a>,      handles.OK})
3356 set(handles.Cancel,                      <span class="string">'Callback'</span>,       {@<a href="#_sub94" class="code" title="subfunction dialogCancel(hObject,eventdata,handles)">dialogCancel</a>,  handles})
3357 
3358 <span class="comment">% Position the dialog and make it visible:</span>
3359 <span class="comment">% ----------------------------------------</span>
3360 fpos = get(hf,<span class="string">'Position'</span>);
3361 dpos = [(fpos(1) + fpos(3)/2 -w/2) (fpos(2) + fpos(4)/2)];
3362 movegui(handles.Figure,dpos)
3363 set(handles.Figure,<span class="string">'Visible'</span>,<span class="string">'on'</span>)
3364 
3365 <span class="comment">% Hold the dialog open:</span>
3366 <span class="comment">% ---------------------</span>
3367 waitfor(handles.OK)
3368 
3369 <span class="comment">% Return the outputs and close the dialog:</span>
3370 <span class="comment">% ----------------------------------------</span>
3371 dialog_params           = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3372 beam_angle              = dialog_params.beam_angle;
3373 magnetic_variation      = dialog_params.magnetic_variation;
3374 wse                     = dialog_params.wse;
3375 output_auxilliary_data  = dialog_params.output_auxilliary_data;
3376 
3377 delete(handles.Figure)
3378 
3379 <span class="comment">% [EOF] exportSettingsDialog</span>
3380 
3381 <span class="comment">% --------------------------------------------------------------------</span>
3382 <a name="_sub97" href="#_subfunctions" class="code">function dialogExportSettings(hObject,eventdata,handles)</a>
3383 
3384 <span class="comment">% Grab the current data</span>
3385 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3386 
3387 <span class="comment">% Set it according to the dialog box values</span>
3388 dialog_params.beam_angle                = get(handles.BeamAngle,<span class="string">'String'</span>);
3389 dialog_params.magnetic_variation        = get(handles.MagneticVariation,<span class="string">'String'</span>);
3390 dialog_params.wse                       = get(handles.WSE,<span class="string">'String'</span>);
3391 dialog_params.output_auxilliary_data    = get(handles.OutputAuxilliaryData,<span class="string">'Value'</span>);
3392 
3393 <span class="comment">% Re-store the application data</span>
3394 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3395 
3396 <span class="comment">% [EOF] dialogExportSettings</span>
3397 
3398 <a name="_sub98" href="#_subfunctions" class="code">function [selected_figures] = openFiguresDialog(figure_names,hf)</a>
3399 
3400 w = 230;
3401 h = 200;
3402 dx = 10;
3403 dy = 35;
3404 the_color = get(0,<span class="string">'factoryUipanelBackgroundColor'</span>);
3405 handles.Figure = figure(<span class="string">'Name'</span>, <span class="string">'Select open figures to export'</span>, <span class="keyword">...</span>
3406     <span class="string">'Color'</span>,the_color, <span class="keyword">...</span>
3407     <span class="string">'NumberTitle'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
3408     <span class="string">'HandleVisibility'</span>,<span class="string">'callback'</span>, <span class="keyword">...</span>
3409     <span class="string">'WindowStyle'</span>,<span class="string">'modal'</span>, <span class="keyword">...</span>
3410     <span class="string">'MenuBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
3411     <span class="string">'ToolBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
3412     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3413     <span class="string">'Position'</span>,[0 0 w h], <span class="keyword">...</span>
3414     <span class="string">'Resize'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
3415     <span class="string">'Visible'</span>,<span class="string">'off'</span>);
3416 dialog_params.figure_names               = figure_names;
3417 dialog_params.selected_figures           = <span class="string">''</span>;
3418 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3419 setappdata(handles.Figure,<span class="string">'original_dialog_params'</span>,dialog_params)
3420 
3421 <span class="comment">% Build the graphics:</span>
3422 <span class="comment">% -------------------</span>
3423 handles.ListboxPanel = uipanel(<span class="string">'Parent'</span>,handles.Figure, <span class="keyword">...</span>
3424     <span class="string">'Title'</span>, <span class="string">'Figures'</span>, <span class="keyword">...</span>
3425     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3426     <span class="string">'Position'</span>,[dx dy (w-2*dx) h-dx-dy+10]);
3427 handles.Figures = uicontrol(<span class="string">'Style'</span>,<span class="string">'listbox'</span>, <span class="keyword">...</span>
3428     <span class="string">'Parent'</span>,handles.ListboxPanel, <span class="keyword">...</span>
3429     <span class="string">'BackGroundColor'</span>,<span class="string">'white'</span>,<span class="keyword">...</span>
3430     <span class="string">'String'</span>,figure_names, <span class="keyword">...</span>
3431     <span class="string">'Min'</span>, 0,<span class="keyword">...</span>
3432     <span class="string">'Max'</span>, 2,<span class="keyword">...</span>
3433     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3434     <span class="string">'Position'</span>,[15 35 (w-5*dx) 100]);
3435 
3436 
3437 handles.OK = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3438     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3439     <span class="string">'String'</span>,  <span class="string">'OK'</span>, <span class="keyword">...</span>
3440     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3441     <span class="string">'Position'</span>,[w/2-80-dx/4 6 80 22]);
3442 handles.Cancel = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3443     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3444     <span class="string">'String'</span>,  <span class="string">'Cancel'</span>, <span class="keyword">...</span>
3445     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3446     <span class="string">'Position'</span>,[w/2+dx/4 6 80 22]);
3447 
3448 <span class="comment">% Update the UI controls:</span>
3449 <span class="comment">% -----------------------</span>
3450 
3451 
3452 <span class="comment">% Set the callbacks:</span>
3453 <span class="comment">% ------------------</span>
3454 set(handles.Figure,            <span class="string">'CloseRequestFcn'</span>,{@<a href="#_sub95" class="code" title="subfunction dialogCloseReq(hObject,eventdata,h_OK)">dialogCloseReq</a>,handles.OK})
3455 set(handles.Figures,           <span class="string">'Callback'</span>,       {@<a href="#_sub99" class="code" title="subfunction dialogSelectFigures(hObject,eventdata,handles)">dialogSelectFigures</a>    handles})
3456 set(handles.OK,                <span class="string">'Callback'</span>,       {@<a href="#_sub93" class="code" title="subfunction dialogOK(hObject,eventdata,h_OK)">dialogOK</a>,       handles.OK})
3457 set(handles.Cancel,            <span class="string">'Callback'</span>,       {@<a href="#_sub94" class="code" title="subfunction dialogCancel(hObject,eventdata,handles)">dialogCancel</a>,   handles})
3458 
3459 <span class="comment">% Position the dialog and make it visible:</span>
3460 <span class="comment">% ----------------------------------------</span>
3461 fpos = get(hf,<span class="string">'Position'</span>);
3462 dpos = [(fpos(1) + fpos(3)/2 -w/2) (fpos(2) + fpos(4)/2)];
3463 movegui(handles.Figure,dpos)
3464 set(handles.Figure,<span class="string">'Visible'</span>,<span class="string">'on'</span>)
3465 
3466 <span class="comment">% Hold the dialog open:</span>
3467 <span class="comment">% ---------------------</span>
3468 waitfor(handles.OK)
3469 
3470 <span class="comment">% Return the outputs and close the dialog:</span>
3471 <span class="comment">% ----------------------------------------</span>
3472 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3473 selected_figures = dialog_params.selected_figures;
3474 
3475 delete(handles.Figure)
3476 
3477 <span class="comment">% [EOF] openFiguresDialog</span>
3478 
3479 <span class="comment">% --------------------------------------------------------------------</span>
3480 <a name="_sub99" href="#_subfunctions" class="code">function dialogSelectFigures(hObject,eventdata,handles)</a>
3481 
3482 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3483 
3484 idx_selected = get(handles.Figures,<span class="string">'Value'</span>);
3485 fig_names    = get(handles.Figures,<span class="string">'String'</span>);
3486 selected     = fig_names(idx_selected);
3487 dialog_params.selected_figures = selected;
3488 
3489 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3490 
3491 
3492 
3493 <span class="comment">% --------------------------------------------------------------------</span>
3494 <a name="_sub100" href="#_subfunctions" class="code">function icons = getIcons</a>
3495 
3496 <span class="comment">% Load data</span>
3497 idx = 1;
3498 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3499     [NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN
3500     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   129   120   135   188   NaN   NaN   NaN
3501     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN    96   189   NaN   NaN   130   NaN    95   NaN
3502     NaN   NaN   206   206   206   206   NaN   NaN   NaN   NaN   NaN   NaN   NaN    84    79   NaN
3503     NaN   206   255   255   255   255   198   197   NaN   NaN   NaN   NaN    83    79    76   NaN
3504     198   255   255   255   255   255   255   198   198   198   198   198   198   212   212   NaN
3505     198   255   255   255   255   255   255   255   255   255   255   255   198   157   197   NaN
3506     198   255   226   198   198   198   198   198   198   198   198   198   198   198   177   NaN
3507     198   255   198   218   255   255   255   255   255   255   255   255   255   255   161   NaN
3508     198   253   198   247   255   255   255   255   255   255   255   255   255   251   155   NaN
3509     198   226   201   255   255   255   255   255   255   255   255   255   231   206   165   NaN
3510     198   207   215   255   255   255   255   255   255   255   255   255   239   198   159   NaN
3511     198   198   240   255   255   255   255   255   255   255   255   255   222   157   159   NaN
3512     198   199   255   255   255   255   255   255   255   255   255   255   191   165   159   NaN
3513     NaN   165   165   165   165   165   165   165   165   165   165   165   165   159   159   NaN
3514     NaN   NaN   159   159   159   159   159   159   159   159   159   159   159   159   NaN   NaN]/255;
3515 
3516 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3517     [NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN
3518     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   145   137   149   195   NaN   NaN   NaN
3519     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   116   196   NaN   NaN   145   NaN   116   NaN
3520     NaN   NaN   162   162   162   162   NaN   NaN   NaN   NaN   NaN   NaN   NaN   107   105   NaN
3521     NaN   162   255   255   255   255   154   197   NaN   NaN   NaN   NaN   106   104   103   NaN
3522     154   255   255   255   255   255   255   154   154   154   154   154   154   208   208   NaN
3523     154   243   243   243   243   243   243   255   255   255   255   255   154   123   197   NaN
3524     154   235   193   154   154   154   154   154   154   154   154   154   154   154   137   NaN
3525     154   215   154   191   255   255   251   255   255   255   255   255   231   255   126   NaN
3526     154   213   154   240   255   255   255   255   255   255   255   255   199   249   123   NaN
3527     154   179   160   255   247   247   247   247   247   247   247   247   190   188   115   NaN
3528     154   162   184   255   235   235   235   235   235   235   235   231   186   154   169   NaN
3529     154   154   228   255   227   227   227   227   227   227   227   223   178   123   169   NaN
3530     154   156   255   215   215   215   215   215   215   215   215   215   153   115   169   NaN
3531     NaN   115   115   115   115   115   115   115   115   115   115   115   115   169   169   NaN
3532     NaN   NaN   169   169   169   169   169   169   169   169   169   169   169   169   NaN   NaN]/255;
3533 
3534 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3535     [NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN
3536     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   166   161   170   202   NaN   NaN   NaN
3537     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   149   205   NaN   NaN   166   NaN   148   NaN
3538     NaN   NaN    34    34    34    34   NaN   NaN   NaN   NaN   NaN   NaN   NaN   141   144   NaN
3539     NaN    34   255   255   255   255    25   197   NaN   NaN   NaN   NaN   142   145   147   NaN
3540     25   255   156   156   156   156   255    25    25    25    25    25    25   200   200   NaN
3541     25   156   140   140   140   140   140   255   255   255   255   255    25    26   197   NaN
3542     25   132    80    25    25    25    25    25    25    25    25    25    25    25    25   NaN
3543     25   132    25   108   255   255   247   255   255   255   255   255   132   255    25   NaN
3544     25   112    25   137   156   156   156   156   156   156   156   156    91   150    25   NaN
3545     25    67    33   165   148   148   148   148   148   148   148   148    83    92    13   NaN
3546     25    38    64   156   132   132   132   132   132   132   132   132    67    25   176   NaN
3547     25    26   122   156   124   124   124   124   124   124   124   124    67    26   176   NaN
3548     25    28   156   108   108   108   108   108   108   108   108   108    41    13   176   NaN
3549     NaN    13    13    13    13    13    13    13    13    13    13    13    13   176   176   NaN
3550     NaN   NaN   176   176   176   176   176   176   176   176   176   176   176   176   NaN   NaN]/255;
3551 
3552 <span class="comment">% Save data</span>
3553 idx = idx+1;
3554 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3555     [NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN
3556     NaN    0.6902    0.6902    0.6902    0.6902    0.6902    0.6274    0.6274    0.5647    0.5647    0.5647    0.5019    0.5019    0.4392    0.2510       NaN
3557     NaN    0.6902    0.7529    0.5647    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.3137    0.3765    0.2510    0.4670
3558     NaN    0.6902    0.7529    0.5647    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.2510    0.1882    0.2510    0.4670
3559     NaN    0.6274    0.7529    0.5019    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.8784    0.1882    0.5019    0.2510    0.4670
3560     NaN    0.6274    0.7529    0.4392    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.8784    0.8157    0.1882    0.4392    0.2510    0.4670
3561     NaN    0.6274    0.7529    0.4392    1.0000    1.0000    1.0000    0.9412    0.9412    0.8784    0.8157    0.7529    0.1255    0.3765    0.2510    0.4670
3562     NaN    0.5647    0.7529    0.3765    1.0000    1.0000    0.9412    0.9412    0.8784    0.8157    0.7529    0.7529    0.0627    0.3765    0.2510    0.4670
3563     NaN    0.5647    0.7529    0.6902    0.3765    0.3137    0.3137    0.2510    0.1882    0.1882    0.1255    0.0627    0.3765    0.3137    0.2510    0.4670
3564     NaN    0.5019    0.6902    0.6902    0.6274    0.5647    0.5019    0.5019    0.5019    0.4392    0.4392    0.3765    0.3137    0.3137    0.2510    0.4670
3565     NaN    0.5019    0.6902    0.6274    0.5647    0.3137    0.3137    0.3137    0.3137    0.3137    0.3765    0.3137    0.3137    0.2510    0.2510    0.4670
3566     NaN    0.4392    0.6274    0.5647    0.5019    0.3137       NaN    0.1882    0.8157    0.8157    0.3765    0.2510    0.2510    0.2510    0.2510    0.4670
3567     NaN    0.4392    0.6274    0.5019    0.5019    0.3137    0.1882    0.4392    0.8784    0.8784    0.4392    0.1882    0.2510    0.1882    0.2510    0.4670
3568     NaN    0.4392    0.5647    0.5019    0.1255    0.1255    0.6902    0.6902    0.7529    0.7529    0.3137    0.1882    0.1882    0.1882    0.2510    0.4670
3569     NaN    0.7333    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.4670
3570     NaN       NaN    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670];
3571 
3572 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3573     [NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN
3574     NaN    0.7216    0.7216    0.6902    0.6902    0.6588    0.6274    0.5961    0.5647    0.5647    0.5333    0.5019    0.4706    0.4706    0.2196       NaN
3575     NaN    0.6902    0.7529    0.5647    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9725    0.3451    0.3451    0.2196    0.5378
3576     NaN    0.6902    0.7529    0.5333    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9725    0.9412    0.3137    0.1882    0.2196    0.5378
3577     NaN    0.6588    0.7529    0.5019    1.0000    1.0000    1.0000    1.0000    1.0000    0.9725    0.9412    0.9098    0.3137    0.4706    0.2196    0.5378
3578     NaN    0.6274    0.7529    0.4706    1.0000    1.0000    1.0000    1.0000    0.9725    0.9412    0.9098    0.8470    0.2824    0.4392    0.2196    0.5378
3579     NaN    0.5961    0.7529    0.4392    1.0000    1.0000    1.0000    0.9725    0.9412    0.9098    0.8470    0.8157    0.2510    0.4078    0.2196    0.5378
3580     NaN    0.5647    0.7529    0.4078    1.0000    1.0000    0.9725    0.9412    0.9098    0.8470    0.8157    0.7843    0.2196    0.3765    0.2196    0.5378
3581     NaN    0.5333    0.7216    0.7216    0.3765    0.3765    0.3451    0.3137    0.3137    0.2824    0.2510    0.2196    0.3765    0.3451    0.2196    0.5378
3582     NaN    0.5019    0.6902    0.6902    0.6274    0.5647    0.5333    0.5019    0.4706    0.4392    0.4078    0.3765    0.3451    0.3137    0.2196    0.5378
3583     NaN    0.4706    0.6588    0.6274    0.5647    0.3451    0.3451    0.3451    0.3451    0.3765    0.4078    0.3451    0.3137    0.2824    0.2196    0.5378
3584     NaN    0.4706    0.6274    0.5647    0.5333    0.3451       NaN    0.2510    0.8470    0.8784    0.4706    0.2824    0.2824    0.2510    0.2196    0.5378
3585     NaN    0.4392    0.5961    0.5333    0.5019    0.3451    0.2510    0.4706    0.8784    0.9098    0.5019    0.2510    0.2510    0.2510    0.2196    0.5378
3586     NaN    0.4078    0.5647    0.5019    0.2824    0.1882    0.7216    0.7216    0.7529    0.7843    0.3137    0.2510    0.2510    0.2196    0.2196    0.5378
3587     NaN    0.7176    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.5378
3588     NaN       NaN    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378];
3589 
3590 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3591     [NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN
3592     NaN    0.9412    0.9412    0.9412    0.9412    0.9412    0.9412    0.8784    0.8784    0.8784    0.8784    0.8784    0.8157    0.8157    0.4392       NaN
3593     NaN    0.9412    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.7529    0.6902    0.4392    0.5997
3594     NaN    0.9412    1.0000    0.9412    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.7529    0.3765    0.4392    0.5997
3595     NaN    0.9412    1.0000    0.8784    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.6902    0.8784    0.4392    0.5997
3596     NaN    0.9412    1.0000    0.8784    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.9412    0.6902    0.8157    0.4392    0.5997
3597     NaN    0.8784    1.0000    0.8157    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.9412    0.8784    0.6274    0.8157    0.4392    0.5997
3598     NaN    0.8784    1.0000    0.8157    1.0000    1.0000    1.0000    0.9412    0.9412    0.9412    0.8784    0.8784    0.6274    0.7529    0.4392    0.5997
3599     NaN    0.8784    1.0000    1.0000    0.8157    0.7529    0.7529    0.7529    0.6902    0.6902    0.6274    0.6274    0.7529    0.7529    0.4392    0.5997
3600     NaN    0.8784    1.0000    1.0000    1.0000    0.9412    0.9412    0.8784    0.8784    0.8157    0.8157    0.7529    0.7529    0.6902    0.4392    0.5997
3601     NaN    0.8157    1.0000    1.0000    0.9412    0.4392    0.4392    0.4392    0.4392    0.4392    0.5019    0.7529    0.6902    0.6902    0.4392    0.5997
3602     NaN    0.8157    1.0000    0.9412    0.9412    0.4392       NaN    0.2510    0.9412    0.9412    0.5019    0.6902    0.6902    0.6274    0.4392    0.5997
3603     NaN    0.8157    1.0000    0.9412    0.8784    0.4392    0.2510    0.5647    0.9412    0.9412    0.5647    0.6274    0.6274    0.6274    0.4392    0.5997
3604     NaN    0.8157    0.9412    0.8784    0.6902    0.2510    0.7529    0.7529    0.8157    0.8157    0.3137    0.6274    0.6274    0.6274    0.4392    0.5997
3605     NaN    0.8275    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.5997
3606     NaN       NaN    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997];
3607 
3608 <span class="comment">% Plotting parameters</span>
3609 idx = idx+1;
3610 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3611     [  0     0     0     0     0     0     0     0     0     0     0     0     0     0     0   255
3612     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3613     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   165
3614     0   255   203    79   213   255   255   255   255   255   254   160   109   247     0   165
3615     0   254    71   224    79   255   255   255   255   255   211   101   165   123     0   165
3616     0   191   123   255   123   203   255   255   255   255   101   224   254    79     0   165
3617     0   101   239   255   224   109   255   255   255   247    79   254   254   123    36   165
3618     0   123   254   255   255    79   247   255   255   165   165   255   255   224     0   165
3619     0   255   255   255   254   160   173   255   255    87   239   255   255   255     0   165
3620     0   255   255   255   255   224   101   255   239    87   255   255   255   255     0   165
3621     0   255   255   255   255   255   101   224   123   191   255   255   255   255     0   165
3622     0   255   255   255   255   254   224    54   101   255   255   255   255   255     0   165
3623     0   255   255   255   255   255   255   247   255   255   255   255   255   255     0   165
3624     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   165
3625     0     0     0     1     0     0     0     0     0     0     0     0     0     0     0   165
3626     255   165   165   165   172   165   165   165   165   165   165   165   165   165   165   165]/255;
3627 
3628 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3629     [  0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
3630     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0     0
3631     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   165
3632     0   255   203    79   213   255   255   255   255   255   254   160   109   247     0   165
3633     0   254    71   224    79   255   255   255   255   255   211   101   165   123     0   165
3634     0   191   123   255   123   203   255   255   255   255   101   224   254    79     0   165
3635     0   101   239   255   224   109   255   255   255   247    79   254   254   123     0   165
3636     0   123   254   255   255    79   247   255   255   165   165   255   255   224     0   165
3637     0   255   255   255   254   160   173   255   255    87   239   255   255   255     0   165
3638     0   255   255   255   255   224   101   255   239    87   255   255   255   255     0   165
3639     0   255   255   255   255   255   101   224   123   191   255   255   255   255     0   165
3640     0   255   255   255   255   254   224    54   101   255   255   255   255   255     0   165
3641     0   255   255   255   255   255   255   247   255   255   255   255   255   255     0   165
3642     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   165
3643     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0   165
3644     0   165   165   165   153   165   165   165   165   165   165   165   165   165   165   165]/255;
3645 
3646 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3647     [  0     0     0     0     0     0     0     0     0     0     0     0     0     0     0   255
3648     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3649     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3650     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3651     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3652     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3653     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3654     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3655     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3656     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3657     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3658     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3659     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3660     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3661     0    24    39     0     0     0     0     0     0     0     0     0     0     0     0   145
3662     255   145   145   145   134   145   145   145   145   145   145   145   145   145   145   145]/255;
3663 
3664 <span class="comment">% Processing parameters</span>
3665 idx = idx+1;
3666 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3667     [255   255   255   255   255   255   255   255   255   255   255   255   255   255   255   255
3668     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255
3669     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3670     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3671     255     0   255   255   107   255   255   107   255   255   107   255   107   255     0   255
3672     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3673     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3674     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3675     255     0   255   255   107   255   107   255   107   255   255   107   255   255     0   255
3676     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3677     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3678     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3679     255     0   255   107   255   107   255   107   255   255   107   255   107   255     0   255
3680     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3681     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3682     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255]/255;
3683 
3684 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3685     [255   255   255   255   255   255   255   255   255   255   255   255   255   255   255   255
3686     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255
3687     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3688     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3689     255     0   255   255    99   255   255    99   255   255    99   255    99   255     0   255
3690     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3691     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3692     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3693     255     0   255   255    99   255    99   255    99   255   255    99   255   255     0   255
3694     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3695     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3696     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3697     255     0   255    99   255    99   255    99   255   255    99   255    99   255     0   255
3698     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3699     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3700     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255]/255;
3701 
3702 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3703     [255   255   255   255   255   255   255   255   255   255   255   255   255   255   255   255
3704     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255
3705     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3706     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3707     255     0   255   255    99   255   255    99   255   255    99   255    99   255     0   255
3708     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3709     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3710     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3711     255     0   255   255    99   255    99   255    99   255   255    99   255   255     0   255
3712     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3713     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3714     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3715     255     0   255    99   255    99   255    99   255   255    99   255    99   255     0   255
3716     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3717     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3718     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255]/255;
3719 
3720 <span class="comment">% Export bathymetry dialog</span>
3721 idx = idx+1;
3722 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3723     [226    226    226    226    226    226    226    197    220    226    226    226    226    226    226    226
3724     226    226    226    226    226    227    241    144    158    241    228    228    229    228    229    226
3725     226    243    243    243    237    237    246    164    119    242    232    225    226    218    243    206
3726     179    152    153    166    148    148    177    179    63    185    141    146    154    151    179    189
3727     167    4    134    175    151    164    161    198    122    255    212    233    215    199    140    185
3728     134    50    209    241    255    255    133    118    15    20    28    94    4    0    0    89
3729     136    0    0    0    0    0    0    0    0    0    0    0    0    21    56    140
3730     208    255    226    233    255    242    215    232    251    237    226    233    207    222    156    139
3731     172    159    152    153    166    145    178    147    169    164    161    163    154    153    128    135
3732     160    164    148    139    171    150    165    154    165    185    166    173    190    190    148    162
3733     214    233    211    203    217    212    217    238    202    236    213    222    230    224    184    184
3734     219    206    174    190    219    204    201    218    183    224    219    222    217    202    176    182
3735     210    182    183    214    225    220    203    229    175    217    220    220    222    212    184    185
3736     197    175    207    224    223    220    205    231    170    221    220    220    222    217    191    187
3737     186    193    223    224    220    201    203    228    171    224    218    220    222    215    190    187
3738     189    211    220    216    204    201    214    213    187    213    216    220    220    212    193    189
3739     ]/255;
3740 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3741     [233    233    233    233    233    233    233    204    227    233    233    233    233    233    233    233
3742     233    233    233    233    233    234    247    152    167    247    235    234    235    234    236    233
3743     233    242    242    240    236    237    247    170    131    243    234    231    234    224    245    212
3744     208    193    199    209    196    196    211    197    100    211    194    196    200    199    202    196
3745     205    19    179    199    183    197    182    179    162    255    217    246    234    231    191    199
3746     167    47    229    240    255    252    139    154    87    86    99    139    79    46    23    121
3747     175    30    47    29    28    19    5    41    33    39    54    55    65    83    81    185
3748     236    255    249    253    255    251    240    255    235    255    247    252    233    245    204    190
3749     208    200    195    196    204    192    214    202    144    215    201    201    195    195    177    186
3750     200    201    189    183    206    192    204    210    111    231    209    214    222    223    199    209
3751     245    255    251    247    254    254    252    255    156    255    254    255    255    254    235    232
3752     249    244    227    237    247    244    242    255    132    239    254    250    247    244    228    231
3753     245    231    231    246    253    249    243    255    119    223    255    251    250    245    229    232
3754     239    227    244    251    251    248    244    255    110    217    255    250    251    246    233    233
3755     233    237    250    252    249    242    246    255    115    209    255    250    251    246    232    232
3756     234    245    249    247    242    242    246    231    154    192    246    249    249    245    234    233
3757     ]/255;
3758 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3759     [233    233    233    233    233    233    233    204    227    233    233    233    233    233    233    233
3760     233    233    233    233    233    234    247    152    167    247    235    234    235    234    236    233
3761     233    242    242    240    236    237    247    170    131    243    234    231    234    224    245    212
3762     208    193    199    209    196    196    211    197    100    211    194    196    200    199    202    196
3763     205    19    179    199    183    197    182    179    162    255    217    246    234    231    191    199
3764     167    47    229    240    255    252    139    154    87    86    99    139    79    46    23    121
3765     175    30    47    29    28    19    5    41    33    39    54    55    65    83    81    185
3766     236    255    249    253    255    251    240    255    235    255    247    252    233    245    204    190
3767     208    200    195    196    204    192    214    202    144    215    201    201    195    195    177    186
3768     200    201    189    183    206    192    204    210    111    231    209    214    222    223    199    209
3769     245    255    251    247    254    254    252    255    156    255    254    255    255    254    235    232
3770     249    244    227    237    247    244    242    255    132    239    254    250    247    244    228    231
3771     245    231    231    246    253    249    243    255    119    223    255    251    250    245    229    232
3772     239    227    244    251    251    248    244    255    110    217    255    250    251    246    233    233
3773     233    237    250    252    249    242    246    255    115    209    255    250    251    246    232    232
3774     234    245    249    247    242    242    246    231    154    192    246    249    249    245    234    233
3775     ]/255;
3776 
3777 <span class="comment">% Export Figures Dialog</span>
3778 idx = idx + 1;
3779 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3780     [NaN    NaN    10    23    23    23    23    23    23    23    21    3    NaN    NaN    NaN    NaN
3781     NaN    NaN    67    255    255    255    255    255    255    255    201    141    NaN    NaN    NaN    NaN
3782     NaN    NaN    43    255    241    240    241    246    252    255    186    220    151    NaN    NaN    NaN
3783     NaN    NaN    42    255    238    237    237    236    238    254    210    178    214    38    NaN    NaN
3784     NaN    NaN    43    255    241    241    241    241    240    244    252    255    255    79    NaN    NaN
3785     NaN    NaN    47    255    232    232    225    224    224    223    220    238    255    69    NaN    NaN
3786     NaN    NaN    55    233    114    225    230    223    221    221    215    237    255    67    NaN    NaN
3787     4    NaN    37    181    168    126    193    214    205    200    203    242    255    67    NaN    NaN
3788     41    164    134    153    144    139    131    209    238    223    242    240    255    67    NaN    NaN
3789     41    118    91    91    122    125    120    106    170    241    245    241    255    67    NaN    NaN
3790     41    113    91    89    97    108    99    89    117    205    190    230    255    67    NaN    NaN
3791     41    124    94    88    78    74    81    179    255    252    244    241    255    67    NaN    NaN
3792     13    34    76    187    88    92    222    255    255    250    250    250    255    73    NaN    NaN
3793     NaN    NaN    69    236    121    227    255    243    238    238    238    238    255    82    NaN    NaN
3794     NaN    NaN    NaN    0    0    0    0    0    0    0    0    0    0    0    NaN    NaN]/255;
3795 
3796 
3797 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3798     [NaN    NaN    10    24    24    24    24    24    24    24    22    4    NaN    NaN    NaN    NaN
3799     NaN    NaN    69    255    255    255    255    255    255    255    204    144    NaN    NaN    NaN    NaN
3800     NaN    NaN    45    255    241    240    241    246    252    255    189    222    155    NaN    NaN    NaN
3801     NaN    NaN    43    255    238    237    237    236    238    254    210    179    215    39    NaN    NaN
3802     NaN    NaN    44    255    241    241    241    241    240    244    252    255    255    80    NaN    NaN
3803     NaN    NaN    49    255    231    230    225    224    224    223    220    238    255    70    NaN    NaN
3804     NaN    NaN    56    227    136    214    227    223    221    221    215    237    255    68    NaN    NaN
3805     4    NaN    19    157    243    154    181    210    204    200    203    242    255    67    NaN    NaN
3806     51    255    231    225    219    217    172    197    232    222    242    240    255    67    NaN    NaN
3807     52    227    184    183    195    201    204    172    169    239    245    241    255    67    NaN    NaN
3808     51    218    177    177    180    187    187    177    130    202    190    230    255    67    NaN    NaN
3809     51    237    195    183    172    170    152    175    255    251    244    241    255    67    NaN    NaN
3810     15    38    72    173    183    149    211    255    255    250    250    250    255    73    NaN    NaN
3811     NaN    NaN    65    226    174    214    252    242    238    238    238    238    255    84    NaN    NaN
3812     NaN    NaN    NaN    0    0    0    0    0    0    0    0    0    0    0    NaN    NaN]/255;
3813 
3814 
3815 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3816     [NaN    NaN    9    23    23    23    23    23    23    23    21    3    NaN    NaN    NaN    NaN
3817     NaN    NaN    66    255    255    255    255    255    255    255    196    139    NaN    NaN    NaN    NaN
3818     NaN    NaN    42    255    239    238    238    244    252    255    186    216    148    NaN    NaN    NaN
3819     NaN    NaN    41    255    236    235    235    234    237    251    210    176    212    36    NaN    NaN
3820     NaN    NaN    42    255    239    239    239    239    238    241    252    255    255    78    NaN    NaN
3821     NaN    NaN    46    255    233    232    224    223    223    223    219    235    255    67    NaN    NaN
3822     NaN    NaN    53    240    101    232    230    221    219    218    213    235    255    65    NaN    NaN
3823     5    NaN    60    212    94    107    205    215    203    198    201    240    255    66    NaN    NaN
3824     34    56    40    80    70    62    94    222    241    221    240    238    255    66    NaN    NaN
3825     35    10    2    0    51    55    36    46    176    240    243    239    255    66    NaN    NaN
3826     35    11    9    7    16    34    12    6    110    204    188    228    255    66    NaN    NaN
3827     35    14    0    0    0    0    14    187    255    251    242    239    255    66    NaN    NaN
3828     12    37    84    206    0    41    234    255    255    248    248    248    255    72    NaN    NaN
3829     NaN    NaN    69    249    79    239    255    240    236    236    236    236    255    80    NaN    NaN
3830     NaN    NaN    NaN    0    0    0    0    0    0    0    0    0    0    0    NaN    NaN]/255;
3831 
3832 
3833 <span class="comment">% [EOF] getIcons</span>
3834 
3835 <a name="_sub101" href="#_subfunctions" class="code">function guiparams = createGUIparams</a>
3836 <span class="comment">% Creates the guiparams structure with specified defaults.</span>
3837 
3838 <span class="comment">% Organized by GUI panels</span>
3839 <span class="comment">%%%%%%%%%%%%%%%%%%%</span>
3840 <span class="comment">% SHIPTRACKS PLOT %</span>
3841 <span class="comment">%%%%%%%%%%%%%%%%%%%</span>
3842 guiparams.horizontal_grid_node_spacing       = 1.0;
3843 
3844 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
3845 <span class="comment">% CROSS SECTION PLOT %</span>
3846 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
3847 guiparams.contours                           = <span class="string">''</span>; <span class="comment">% Set below</span>
3848 guiparams.contour                            = <span class="string">''</span>; <span class="comment">% Set below</span>
3849 guiparams.idx_contour                        = 1;
3850 guiparams.vertical_exaggeration              = 10;
3851 guiparams.vector_scale_cross_section         = 0.2;
3852 guiparams.horizontal_vector_spacing          = 1;
3853 guiparams.vertical_vector_spacing            = 1;
3854 guiparams.horizontal_smoothing_window        = 1;
3855 guiparams.vertical_smoothing_window          = 1;
3856 guiparams.plot_secondary_flow_vectors        = true;
3857 guiparams.secondary_flows                    = <span class="string">''</span>; <span class="comment">% Set below</span>
3858 guiparams.secondary_flow_vector_variable     = <span class="string">''</span>; <span class="comment">% Set below</span>
3859 guiparams.idx_secondary_flow_vector_variable = 1;
3860 guiparams.include_vertical_velocity          = true;
3861 
3862 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
3863 <span class="comment">% PLAN VIEW PLOT %</span>
3864 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
3865 guiparams.depth_range_min                    = 0;
3866 guiparams.depth_range_max                    = inf;
3867 guiparams.vector_scale_plan_view             = 1;
3868 guiparams.vector_spacing_plan_view           = 1;
3869 guiparams.smoothing_window_size              = 1;
3870 guiparams.map_depth_averaged_velocities      = true;
3871 guiparams.display_shoreline                  = false;
3872 guiparams.add_background                     = false;
3873 
3874 <span class="comment">%%%%%%%%%%%%%%%</span>
3875 <span class="comment">% DATA EXPORT %</span>
3876 <span class="comment">%%%%%%%%%%%%%%%</span>
3877 guiparams.beam_angle                         = 20.0;
3878 guiparams.magnetic_variation                 = 0.0;
3879 guiparams.wse                                = 0.0;
3880 guiparams.output_auxiliary_data              = false;
3881 
3882 <span class="comment">%%%%%%%%%%%%%%%%%%%%%</span>
3883 <span class="comment">% Contour variables %</span>
3884 <span class="comment">%%%%%%%%%%%%%%%%%%%%%</span>
3885 idx = 1;
3886 guiparams.contours(idx).string   = <span class="string">'Streamwise Velocity (u)'</span>;
3887 guiparams.contours(idx).variable = <span class="string">'streamwise'</span>;
3888 idx = idx + 1;
3889 guiparams.contours(idx).string   = <span class="string">'Transverse Velocity (v)'</span>;
3890 guiparams.contours(idx).variable = <span class="string">'transverse'</span>;
3891 idx = idx + 1;
3892 guiparams.contours(idx).string   = <span class="string">'Vertical Velocity (w)'</span>;
3893 guiparams.contours(idx).variable = <span class="string">'vertical'</span>;
3894 idx = idx + 1;
3895 guiparams.contours(idx).string   = <span class="string">'Velocity Magnitude'</span>;
3896 guiparams.contours(idx).variable = <span class="string">'mag'</span>;
3897 idx = idx + 1;
3898 guiparams.contours(idx).string   = <span class="string">'Primary Velocity (zsd)'</span>;
3899 guiparams.contours(idx).variable = <span class="string">'primary_zsd'</span>;
3900 idx = idx + 1;
3901 guiparams.contours(idx).string   = <span class="string">'Secondary Velocity (zsd)'</span>;
3902 guiparams.contours(idx).variable = <span class="string">'secondary_zsd'</span>;
3903 idx = idx + 1;
3904 guiparams.contours(idx).string   = <span class="string">'Primary Velocity (Roz)'</span>;
3905 guiparams.contours(idx).variable = <span class="string">'primary_roz'</span>;
3906 idx = idx + 1;
3907 guiparams.contours(idx).string   = <span class="string">'Secondary Velocity (Roz)'</span>;
3908 guiparams.contours(idx).variable = <span class="string">'secondary_roz'</span>;
3909 idx = idx + 1;
3910 guiparams.contours(idx).string   = <span class="string">'Prim. Vel. (Roz, Downstream Comp.)'</span>;
3911 guiparams.contours(idx).variable = <span class="string">'primary_roz_x'</span>;
3912 idx = idx + 1;
3913 guiparams.contours(idx).string   = <span class="string">'Prim. Vel. (Roz, Cross-Stream Comp.)'</span>;
3914 guiparams.contours(idx).variable = <span class="string">'primary_roz_y'</span>;
3915 idx = idx + 1;
3916 guiparams.contours(idx).string   = <span class="string">'Sec. Vel. (Roz, Downstream Comp.)'</span>;
3917 guiparams.contours(idx).variable = <span class="string">'secondary_roz_x'</span>;
3918 idx = idx + 1;
3919 guiparams.contours(idx).string   = <span class="string">'Sec. Vel. (Roz, Cross-Stream Comp.)'</span>;
3920 guiparams.contours(idx).variable = <span class="string">'secondary_roz_y'</span>;
3921 idx = idx + 1;
3922 guiparams.contours(idx).string   = <span class="string">'Backscatter'</span>;
3923 guiparams.contours(idx).variable = <span class="string">'backscatter'</span>;
3924 idx = idx + 1;
3925 guiparams.contours(idx).string   = <span class="string">'Flow Direction (deg.)'</span>;
3926 guiparams.contours(idx).variable = <span class="string">'flowangle'</span>;
3927 
3928 guiparams.contour = guiparams.contours(guiparams.idx_contour).variable;
3929 
3930 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3931 <span class="comment">% Secondary Flow Vector Variables %</span>
3932 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3933 idx = 1;
3934 guiparams.secondary_flows(idx).string   = <span class="string">'Transverse'</span>;
3935 guiparams.secondary_flows(idx).variable = <span class="string">'transverse'</span>;
3936 idx = idx + 1;
3937 guiparams.secondary_flows(idx).string   = <span class="string">'Secondary (zsd)'</span>;
3938 guiparams.secondary_flows(idx).variable = <span class="string">'secondary_zsd'</span>;
3939 idx = idx + 1;
3940 guiparams.secondary_flows(idx).string   = <span class="string">'Secondary (Roz)'</span>;
3941 guiparams.secondary_flows(idx).variable = <span class="string">'secondary_roz'</span>;
3942 idx = idx + 1;
3943 guiparams.secondary_flows(idx).string   = <span class="string">'Secondary (Roz, Cross-Stream Comp)'</span>;
3944 guiparams.secondary_flows(idx).variable = <span class="string">'secondary_roz_y'</span>;
3945 idx = idx + 1;
3946 guiparams.secondary_flows(idx).string   = <span class="string">'Primary (Roz, Cross-Stream Comp)'</span>;
3947 guiparams.secondary_flows(idx).variable  = <span class="string">'primary_roz_y'</span>;
3948 
3949 guiparams.secondary_flow_vector_variable = <span class="keyword">...</span>
3950     guiparams.secondary_flows(guiparams.idx_secondary_flow_vector_variable).variable;
3951 
3952 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3953 <span class="comment">% INTERNAL SETTINGS &amp; DEFAULTS %</span>
3954 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3955 <span class="comment">% Menu bar options</span>
3956 guiparams.presentation                       = true;
3957 guiparams.print                              = false;
3958 guiparams.set_cross_section_endpoints        = false;
3959 guiparams.unit_discharge_correction          = false;
3960 guiparams.english_units                      = false;
3961 guiparams.vertical_offset                    = 0;
3962 <span class="comment">% guiparams.plot_ship_tracks                   = false;</span>
3963 <span class="comment">% guiparams.plot_planview                      = false;</span>
3964 <span class="comment">% guiparams.plot_cross_section                 = false;</span>
3965 
3966 <span class="comment">% File location defaults</span>
3967 guiparams.ascii_path                        = pwd;
3968 guiparams.ascii_file                        = <span class="string">''</span>;
3969 guiparams.mat_path                          = pwd;
3970 guiparams.mat_file                          = <span class="string">''</span>;
3971 guiparams.tecplot_path                      = pwd;
3972 guiparams.tecplot_file                      = <span class="string">''</span>;
3973 guiparams.kmz_path                          = pwd;
3974 guiparams.kmz_file                          = <span class="string">''</span>;
3975 guiparams.multibeambathymetry_path          = pwd;
3976 guiparams.multibeambathymetry_file          = <span class="string">''</span>;
3977 guiparams.log_path                          = pwd;
3978 guiparams.log_file                          = <span class="string">''</span>;
3979 <span class="comment">% Avoids problems of not finding the MCR root when running as a standalone</span>
3980 <span class="comment">% application</span>
3981 <span class="keyword">if</span> isdeployed 
3982     guiparams.has_mapping_toolbox           = true;
3983 <span class="keyword">else</span>
3984     guiparams.has_mapping_toolbox               = <span class="keyword">...</span>
3985         ~isempty(dir(fullfile(matlabroot,<span class="string">'toolbox'</span>,<span class="string">'map'</span>)));
3986 <span class="keyword">end</span>
3987 
3988 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3989 <span class="comment">% IN MEMORY DATA STORAGE %</span>
3990 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3991 guiparams.z                      = [];
3992 guiparams.A                      = [];
3993 guiparams.V                      = [];
3994 guiparams.Map                    = [];
3995 guiparams.savefile               = [];
3996 guiparams.iric_anv_planview_data = [];
3997 <span class="comment">% guiparams.zmin = []; % Don't need to store these?</span>
3998 <span class="comment">% guiparams.zmax = [];</span>
3999 <span class="comment">% guiprefs = getappdata(handles.figure1,'guiprefs');</span>
4000 guiparams.data_folder = <span class="string">''</span>;
4001 guiparams.data_files  = {<span class="string">''</span>};
4002 
4003 <span class="comment">% [EOF] createGUIparams</span>
4004 
4005 <span class="comment">% [EOF] VMT</span>
4006 
4007 
4008 
4009</pre></div>
<hr><address>Generated on Tue 30-Apr-2013 10:18:12 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2005</address>
</body>
</html>